Hi:
It that possible to load javascript from local storage like <script src="file://abc/def/ghi/jkl.js"></script> instead of local web server inside hs.webview:html?
I already read the documents and search all issues about local files webview before asking.
I try to figure it out, but no lucks. :(
You definitely can... I use Resty to make templating easier:
@latenitefilms Thanks, would you mind give me more detail examples about how to include javascript from local directory through resty template?
Take @asmagill's configuration for example, what's the difference if I generate the HTML string directly or compiled through the resty template engine?
Sorry, I鈥檓 on the road, so just quickly replying on my phone. Here鈥檚 how we鈥檙e using it:
https://github.com/CommandPost/CommandPost/blob/develop/src/plugins/finalcutpro/hud/manager/init.lua
In @asmagill鈥檚 example he鈥檚 firing up a web server via Hammerspoon and accessing the JS file through that via the webview.
See https://github.com/asmagill/hammerspoon-config/issues/5 for my solution to get around requiring a local web server
@asmagill Thanks for your help, I already follow your method and use the javascript from local directory through webview.usercontent.
@latenitefilms Thanks for help, I am still reading your code, and try to figure how you solve issue. through resty template engine.
I'll close this issue, and thanks for all of your help!