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

Toggle on/off userscripts for specific websites #225

Open
KamilTheDev opened this issue Feb 3, 2022 · 8 comments
Open

Toggle on/off userscripts for specific websites #225

KamilTheDev opened this issue Feb 3, 2022 · 8 comments
Labels
discussion Any question, feedback or general comment enhancement Feature work

Comments

@KamilTheDev
Copy link

Is it possible to toggle on/off a userscript only for a specific website? Seems I can only toggle a script for ALL websites only.

For example, I have a dark-mode script that runs on all websites. However, I'd like to turn it off for just some specific websites.

It'd be nice if there'd be an extra button to "turn script on/off for just this website". I know I can manually edit the script to @exclude, but it's not very intuitive.

If this is already a feature, please let me know how. Thanks.

@quoid
Copy link
Owner

quoid commented Feb 3, 2022

@KamilTheDev

I know I can manually edit the script to @exclude, but it's not very intuitive.

As you guessed, this is how you would do that. Could you explain why you don't think it is intuitive to do this?

@KamilTheDev
Copy link
Author

It's much more convenient and fast to "toggle on/off for this website" in just a single button press. Especially for iOS.

Dark-mode script as one example: I'm doing a quick google search, come across a website that doesn't work well with dark mode (or I prefer in light mode). Being able to toggle it off for that website quickly, and continue normal browsing.

Right now, I have to:

  1. Copy current URL (annoying if I had something already in clipboard)
  2. Leave Safari
  3. Open code editor and select the specific Userscript file
  4. Type out "@exclude" and paste URL, and cut off anything after the domain

Disrupts my browsing, and takes me over 10 seconds.
Now, with a button that toggles the script for current website, it'd take less than a second without leaving Safari.

Overall, a more user-friendly experience. Also, when there's a userscript update, it could overwrite my custom @exclude's.

Even a small green/red circle to act as the button toggle for current website would suffice. Example:
85B18486-E542-4E83-BFDD-08C706E955EF

Hope you consider it. Thanks.

@quoid
Copy link
Owner

quoid commented Feb 4, 2022

@KamilTheDev thanks for clarifying and providing examples.

I can see how this could be beneficial. Right now there's a lot of pending development tasks, but once 4.1 ships out I will certainly keep this in mind for one of the next minor version releases, if there's a viable approach to it.

@quoid quoid added feature request discussion Any question, feedback or general comment labels Feb 4, 2022
@KamilTheDev
Copy link
Author

Another idea, is that the "Matched Userscripts List for current page" act as the current website toggle, and the "all scripts view" (folder button on iOS) act as the global toggle. This is the behaviour I was expecting when I first used it.

Either way, thanks for taking my feedback. Looking forward to it.

@quoid
Copy link
Owner

quoid commented Feb 5, 2022

Matched Userscripts List for current page" act as the current website toggle, and the "all scripts view" (folder button on iOS) act as the global toggle.

That's a cool idea.

I reckon this task will take a lot of consideration and thought. For example, there's no "all scripts view" in desktop, how is handled there? Is there a way to keep functionality as is while implementing a new interaction for this specific task? Will it be clear to the user what's going on? etc...

I really do think this would be a valuable feature addition, but I want to make sure it doesn't add any ux confusion.

@quoid quoid added the help wanted Extra attention is needed label Feb 5, 2022
@quoid quoid added this to the macOS 4.3, iOS 1.3 milestone Apr 8, 2022
@sixiansheng
Copy link

我也需�这个功能,

@quoid quoid removed this from the macOS 4.3, iOS 1.3 milestone May 2, 2022
@quoid quoid added enhancement Feature work and removed feature labels May 1, 2023
@ACTCD ACTCD added this to Tasks Aug 19, 2024
@ACTCD ACTCD moved this to To do in Tasks Aug 19, 2024
@ACTCD ACTCD removed help wanted Extra attention is needed discussion Any question, feedback or general comment labels Jan 6, 2025
@ACTCD
Copy link
Collaborator

ACTCD commented Jan 6, 2025

Another idea, is that the "Matched Userscripts List for current page" act as the current website toggle, and the "all scripts view" (folder button on iOS) act as the global toggle. This is the behaviour I was expecting when I first used it.

Either way, thanks for taking my feedback. Looking forward to it.

I don't think this is the solution, it adds to the confusion.

I think maybe the only correct way to implement this is the one like other extensions that adds a user-level exclusion list and overrides the script itself.

The discussion here is whether this added complexity is worth it.

For example we could add a button "Disable for this site" and add a *.example.com to the user-level exclusion list, but this means the granularity may not be clear enough.

So maybe the better approach is still for the user to maintain an own version of the user script.

@ACTCD ACTCD added the discussion Any question, feedback or general comment label Jan 6, 2025
@ACTCD ACTCD removed the status in Tasks Jan 6, 2025
@ACTCD
Copy link
Collaborator

ACTCD commented Jan 6, 2025

And I also think "Dark-mode script" is not a suitable use case here, because:

  • It is better suited as a standalone extension rather than a user script (I think)

  • It requires earlier injection (document-start) or additional control and complexity

  • It sometimes should be enabled or disabled individually even in different paths of the same website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Any question, feedback or general comment enhancement Feature work
Projects
Status: No status
Development

No branches or pull requests

4 participants