luciopaiva / witchcraft

Inject Javascript and CSS right from your file system. Think GreaseMonkey for more advanced users.
https://luciopaiva.com/witchcraft
MIT License
254 stars 18 forks source link

The js and css modification is not being picked up by the extension without reloading the page #31

Closed shihshen closed 3 years ago

shihshen commented 3 years ago

I noticed the modification is not being picked up by the extension without reloading the page. In the official page, the feature is described as below. Script changes are seamless Whenever you edit or create new scripts, there's no need to reload anything other than the page where the scripts are supposed to run. This is what makes Witchcraft special and different from other popular scripting tools, like Greasemonkey or Tampermonkey;

I also don't see how can this be done without polling or websocket in the source code. Have I misunderstood this feature?

shihshen commented 3 years ago

I see. It does say page reload is needed. Thank you for the clarification.

Glaived commented 3 years ago

You can launch a proxy server via browser-sync to do local development with hot reloading.

e.g: browser-sync 'https://www.google.com/' --listen 'localhost' --files '**/*.css, **/*.js' --no-inject-changes

and you can work on localhost.css,js for your development phase