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

Update and improve old userscript #191

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shinji257
Copy link
Contributor

Here is an updated user script to replace the old one. URLs are fixed as appropriate and it is now using an appropriate document listener so it doesn't waste time in loading.

  • change setTimeout to addEventListener
  • Use @run-at to get it to load at an appropriate timeframe so that the above change can actually work. Seems to work consistently. Tested in Chrome using Tampermonkey and Firefox using Greasemonkey.
  • Fix a few url pointers. Pointed downloadurl and updateurl to the rawgithub.com version of the url so that it gets the raw version and pointed the src setAttribute appropriately. Due to strict checking in Tampermonker (at least) it is necessary since github's normal raw url sends as text/plain instead of text/javascript. Seems rawgithub.com uses the expected doc type.
  • Changed the commented dev/master urls to the main website instead of tha raw version since it is giving an invalid request error anyways. Not sure what the intent was on those comments.

Update and improve old userscript

* change setTimeout to addEventListener
* Use @run-at to get it to load at an appropriate timeframe so that the above change can actually work.  Seems to work consistently.  Tested in Chrome using Tampermonkey and Firefox using Greasemonkey.
* Fix a few url pointers.  Pointed downloadurl and updateurl to the rawgithub.com version of the url so that it gets the raw version and pointed the src setAttribute appropriately.  Due to strict checking in Tampermonker (at least) it is necessary since github's normal raw url sends as text/plain instead of text/javascript.  Seems rawgithub.com uses the expected doc type.
* Changed the commented dev/master urls to the main website instead of tha raw version since it is giving an invalid request error anyways.  Not sure what the intent was on those comments.
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.

1 participant