Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Userscript (Fixes #564) #565

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Explosion-Scratch
Copy link

@Explosion-Scratch Explosion-Scratch commented Oct 12, 2023

Fixes #564

@infokiller
Copy link
Owner

General comment: please follow the dev guidelines: https://github.com/infokiller/web-search-navigator#coding-style
(including formatting, commit messages, etc.)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add this empty file?

OPTIONS_JS=$(cat "$PTH/options.js" | base64)
BROWSER_POLYFILL_JS=$(cat "$PTH/userscript-polyfill.js" "$PTH/browser-polyfill.js" | base64)

FINAL=$(echo "${USERSCRIPT_OPTIONS//__OPTIONS_HTML__/$OPTIONS_HTML}")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use echo here and below

@@ -0,0 +1,46 @@
mkdir -p build/userscript
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a proper shebang line (look at other files and follow their style)

@@ -0,0 +1,34 @@
globalThis.IS_USERSCRIPT = true;

globalThis._localStorage_browser_polyfill = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_browser_userscript_polyfill and _localStorage_browser_polyfill have inconsistent names (camel case mixed in, different order).

}

save() {
localStorage.setItem(STORAGE_KEY, JSON.stringify(this.values));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is localStorage defined? Is it from the userscript manager?

@Explosion-Scratch
Copy link
Author

@infokiller Appreciate your review - Working on implementing an options page, will use GM_setValue and GM_getValue in userscript environments, then I'll rewrite commit msgs. Might not get a chance for a few weeks though.

@infokiller
Copy link
Owner

@Explosion-Scratch no worries, and I also don't expect changes that will make it hard to merge your fork in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Userscript Version
2 participants