StrokesPlus.net Forum
»
General Discussion
»
Feature Requests
»
Perform different functions on different web pages.
Rank: Advanced Member
Groups: Approved
Joined: 5/6/2019(UTC) Posts: 111 Thanks: 19 times Was thanked: 1 time(s) in 1 post(s)
|
Hello,Rob
I want to know if S+ can perform different functions on different web pages in Google Chrome. For example, in a youtube page, you can increase or decrease the volume by scrolling the mouse wheel, but in other URLs you can perform the function of zooming the page. It may not be possible, but it is very practical.
Looking forward to your reply
|
|
|
|
Rank: Advanced Member
Groups: Translators, Approved Joined: 7/17/2021(UTC) Posts: 135
Thanks: 35 times Was thanked: 18 time(s) in 15 post(s)
|
One way of doing it might be: - Focusing on address bar (with Ctrl+E, Ctrl+X or whatever shortcut you may have)
Copying its URL (with Ctrl+C) Storing it in a variable in script Comparing it with "youtube" or any other domain (using regex for example) And then taking different actions using switch or if-else statements Good luck : )
|
|
|
|
Rank: Advanced Member
Groups: Translators, Approved Joined: 7/17/2021(UTC) Posts: 135
Thanks: 35 times Was thanked: 18 time(s) in 15 post(s)
|
UpdateCheck out the Title function from SystemWindow section of script help in S+. It returns the title(as a string) of active window, such as 'C Drive', 'Youtube - Chrome', 'SomeVideoTitle - Youtube - Chrome' and so on. You can then use regex to look for lets say 'YouTube' in the returned title string and choose actions of your choice. Those actions will only execute if Title contains YouTube in them. So mostly when you're on youtube.com and maybe when you're on a site with title like 'YouTube disables dislike feature - CNN - Chrome', which can further be eliminated if you search for 'YouTube - Chrome' instead of just they keyword 'YouTube'. I haven't tested it, just tested the .title function for its behavior but it should work. Hope this helps.
|
1 user thanked randomConstant for this useful post.
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
Feature Requests
»
Perform different functions on different web pages.
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close