Witchcraft

Frequently Asked Questions

Q: Where should I put my Witchcraft scripts?

A: You must put them in the same folder being served by Web Server Chrome app. Read full instructions here.

Q: Why do I need to install Web Server Chrome app?

A: Witchcraft will look for scripts in http://127.0.0.1:5743 (e.g., http://127.0.0.1:5743/github.com.js). It doesn't have its own web server, that's why it depends on Web Server Chrome app. You don't need to use Web Server Chrome app if you don't want to, as long as you replace it with another local web server listening on port 5743 and serving static files from your Witchcraft scripts folder. For a comprehensive list of local server options, check this gist.

Q: But couldn't Witchcraft spawn its own local web server?

A: No. It is a Chrome extension. Chrome extensions don't have permission to access your file system. You need a Chrome app for that, but it turns out Chrome apps are no longer being supported by Google. This means you can't publish any new Chrome apps. However, existing Chrome apps (like the Web Server Chrome app) are still being supported, so it's ok to rely on them.

Q: When exactly my script gets loaded?

A: It's loaded at document_start. This is after any css files, but before any other DOM is constructed or any other script is run. If you need, you can wait for DOMContentLoaded or the window load event.

Q: I'm unable to read custom properties from or change the window object. What is wrong?

A: Scripts can't directly access the window object. This is a restriction imposed by the Chrome extension API. You can, however, work around it easily.

Q: Can I install Witchcraft from sources instead?

A: Yes, you can install Witchcraft directly from sources instead of downloading it from the Chrome store. Look for the extension source under the folder `/chrome-extension` and manually load it as an unpacked extension. If you don't know how to load unpacked extensions in Chrome, just google it; it's very easy.


Made by Lucio Paiva - July 2018

View source on GitHub