Programmable button scripts are really useful but having to click them can get really repetitive/annoying when you find yourself clicking it everytime you visit a certain website.
I think it'd be useful to add triggers on programmable buttons to "run" when certain urls are loaded for example.
Some examples I can think of:
- A website you visit often is hardcoded to light mode, so you click your Dark Mode programmable button every time you visit. You could instead add a setting to autorun the Dark Mode script when the website URL is visited.
- You don't log into YouTube / clear your login cookies, but you want to view age-restricted videos a lot. You have the bypass age-restriction userscript loaded onto a programmable button, but it could instead be set up to run every time you open a YouTube video, which would unlock the video if it was restricted.
- You have a button to alter the CSS styling of a website to suit your needs. A website you visit a lot needs this every time you visit, so you could set it up to automatically run when you visit the site.
The way I see this implemented is through an option within the programmable button Run Code settings where you can specify site(s) which should autorun the script on load.
A caveat is that if a user has a button dedicated solely to automatic triggers, they would no longer have a need to have the button in the toolbar in the first place, as it's never clicked. They couldn't hide it either, as to my knowledge, the button is only set up once it is placed on the toolbar, and removing it removes the data associated with it.
A possible alternate implementation would be to have custom scripts live in a menu somewhere else, but you can argue that it becomes a completely separate feature from programmable buttons. This also becomes really similar to popular extensions like tampermonkey, etc. I would definitely prefer if Orion handled automatic userscripts natively, and it doesn't seem like too big of an ask given the current functionality of programmable buttons.
Extending this even further, it would be really nice if Orion could natively handle custom stylesheets / CSS for specified websites in a similar way, but this is probably an ask for a separate suggestion.