Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 2.08 KB

FAQ.md

File metadata and controls

54 lines (34 loc) · 2.08 KB

Frequently Asked Questions (FAQ)

Isn't an userscript manager dangerous?

No, userscript managers themselves are not dangerous. They are browser extensions that allow you to run custom scripts on websites. The scripts themselves can be dangerous, but you should only install scripts from sources you trust. If you have any doubts, you can always check the source code of the script. You may want to add important (banking) websites to the blacklist of your userscript manager or use a whitelist.

Does ProtocolDroid work on mobile devices?

As long as your mobile browser supports userscript managers, ProtocolDroid should work. ProtocolDroid is primarily designed for desktop browsers, but developed with mobile browsers in mind (and tested on Firefox for Android).

How would feature X be even remotely useful?

ProtocolDroid is designed for protocol writing of Kiel Universities computer science student organisation. Therefore, some features might be very specific to this and only this use case.

How do I build the script?

You can build the script by running npm run build. The script will be built to the dist directory. You may want to change the headers in src/headers.js to fit your needs.

How do I use the script withouth a userscript manager?

ProtocolDroid uses APIs, that are not available in a normal browser environment. You can inject the following workarounds before the script to keep the script working:

Workaround for GM_addStyle

this.GM_addStyle ??= style => {
    const styleEl = document.createElement('style');
    styleEl.textContent = style;
    document.head.append(styleEl);
};

Workaround for unsafeWindow

this.unsafeWindow ??= window;

Workaround for GM_setValue and GM_getValue

this.GM_setValue ??= (key, value) =>
    localStorage.setItem(`GM_${key}`, JSON.stringify(value));
this.GM_getValue ??= (key, defaultValue) => {
    const value = localStorage.getItem(`GM_${key}`);
    return value === null ? defaultValue : JSON.parse(value);
};