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

@include tags cause TamperMonkey to slow down #80

Open
MagicLegend opened this issue Aug 17, 2017 · 14 comments
Open

@include tags cause TamperMonkey to slow down #80

MagicLegend opened this issue Aug 17, 2017 · 14 comments
Labels
help wanted 🙏 Extra attention is needed

Comments

@MagicLegend
Copy link

MagicLegend commented Aug 17, 2017

Hi all,

I've created this issue on the Tampermonkey forums. After a bit of digging I found that the regex used in the @include tags are the issue. I've solved it by removing the regex from the tags; resulting in this:

// @include https://*stackoverflow.com/*
// @include https://*stackexchange.com/*
// @include https://*serverfault.com/*
// @include https://*superuser.com/*
// @include https://*stackapps.com/*
// @include https://*mathoverflow.net/*
// @include https://*askubuntu.com/*

This fixes the issue described at the TM forum, but I believe it would also react to fakestackoverflow.com. Any good solutions for this?

~ML

@Mottie
Copy link
Member

Mottie commented Aug 17, 2017

Hi @MagicLegend!

If I understand correctly, you're installing the Stackoverflow-dark style from userstyles.org as a userscript? The css wrapping @-moz-document does include regexp, but only to target and ignore other specific stackoverflow subdomains. If you only want advice on how to fix the above @includes then I would try the following (essentially remove the first * from the url):

// @include https://stackoverflow.com/*
// @include https://stackexchange.com/*
// @include https://serverfault.com/*
// @include https://superuser.com/*
// @include https://stackapps.com/*
// @include https://mathoverflow.net/*
// @include https://askubuntu.com/*
// @exclude  https://www.stackexchange.com/*
// @exclude  https://area51.stackexchange.com/*
// @exclude  https://gaming.stackexchange.com/*

Or, are you asking us to fix the @-moz-document rules?

@MagicLegend
Copy link
Author

If I remove the first * the subdomains won't be included :) So chat.stackoverflow.com doesn't work.

I am indeed using it as a userscript given that I don't really need something else to keep track of it, I can do that myself just fine :)

I'm not exactly sure what the issue is there (see the forum post I linked to); I hoped you might have had an idea on how to fix it permanently :)

@Mottie
Copy link
Member

Mottie commented Aug 17, 2017

Oh, then you'll need to add subdomains as well...

// @include https://stackoverflow.com/*
// @include https://*.stackoverflow.com/*
// ...

Make sure to include the period (.) after the asterisk, or will will target fakestackoverflow.com.

I don't have any control over userstyles.org and how to creates a userscript, but we might be able to clean up some of the @-moz-document definitions.

@MagicLegend
Copy link
Author

Oh yeah, derp. Just add two include's for the subdomains. Stupid that I didn't think of that myself lol.

Oh, hmm... Where should I post this issue then?

@Mottie
Copy link
Member

Mottie commented Aug 18, 2017

Issue about what? Fixing the userstyle?... If you mean adjusting the @-moz-document definitions, I'll have to put that on my to-do list for now, and the issue here is adequate.

@Mottie Mottie added enhancement ⭐ New feature or request help wanted 🙏 Extra attention is needed labels Aug 18, 2017
@MagicLegend
Copy link
Author

The issue is that the regex used in the userscript is slowing down Tampermonkey in Chrome so much that some sites (for me it was a google search most of the time, but I've had it on every page I visited a few times) won't load at all. As noted by me, removing the regex from the @include tags fixes this issue.

@MagicLegend
Copy link
Author

I see where your confusion is coming from; I'm still on an older version of the script which didn't use the @-moz-document.

I'll update my script, and see if the issue will be resolved :)

@MagicLegend
Copy link
Author

Ay, learnt something today. @-moz-document isn't supported (currently) in Chrome. My knowledge (and google searches) can't find a better solution than to add the //@include tags to the script.

The userscript version found on userstyles.org doesn't appear to work in Tampermonkey either. When adding the //@include tags it does work tho.

@Mottie
Copy link
Member

Mottie commented Aug 26, 2017

Yeah, userstyles.org & Stylish were bought by another group and they made a few changes but now they are severely neglecting both.

Are you completely opposed to using a browser extension? If you don't want to use Stylish, there is Stylus.

@MagicLegend
Copy link
Author

Yes and no; I'm not opposed to it, but I don't like more clutter and another privacy policy (he said as he started looking into the privacy policy and found the best one ever). Okay, I guess there aren't any real issues with Stylus that I had with Stylish ;) I prefer having the script under my own supervision, but when I break it again (it will happen xD) I might just consider getting Stylus. Right now this is the only userstyle I use on the internet, so there is not really a point in getting another extension for it, but when the time comes I'm frustrated by Github trying to blow my eyes out I might just get it ;)

Too bad there isn't a direct script version available, I'm honestly not sure how I did it back then... The version I had was from march this year, so dunno... Thank you for your time and thoughts, I guess the issue isn't really there anymore given that the script version isn't available anywhere anymore!

@Mottie
Copy link
Member

Mottie commented Aug 27, 2017

We have a userscript for GitHub, but not for Stack Exchange... I've got too much on my plate to write/support a userscript for that site as well.

@MagicLegend
Copy link
Author

Not a problem mate; I just need to add the //@include tags to the script file generated by userstyles and it'll work just fine. Might be nice thing to add to the installation instructions :)

@Mottie
Copy link
Member

Mottie commented Aug 27, 2017

It's a wiki page - https://github.com/StylishThemes/StackOverflow-Dark/wiki/Install - I would appreciate it if you could help out and add a section in there somewhere 😉.

@MagicLegend
Copy link
Author

Ah cool! I'll take a min to write it out then :)

@the-j0k3r the-j0k3r removed the enhancement ⭐ New feature or request label Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🙏 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants