The efficient way to debug JS/CSS in production site
With this package, I can just write the code in a JS file according the domain, e.g. google.com.js,
so long the URL matched
google.com, it will execute the code from google.com.js.
(You can find the google sample code from the installation guide)
Another use case for myself, is I can use to scrap website content, and test my script here.
Everytime I want to test and see the output, I have to keep running the command over & over again. e.g.
Running the script take longer time, as need to instantiate the browser, then load the page, evaluate the script, close browser.
With Witchcraft, I can now write the
// JS code goes here to mydomain.com.js, and view the output in console.
After the output correct, then I just copy the JS code over to the scraper.
I’ve tried this on one of the eCommerce website
And I able to get output
You won’t want to write these in Chrome console right? 😏