Contest: Take Command and show your best Chains
-
Vivaldi is so comfortable that I don't need many command chains. For example, I open the same pages everyday using a middle click on a Speed Dial folder – no need to use any command chain here.
At first, I thought that command chains are cool, but I don't need any, but now I see I do need a few. -
Chain 1
"Stack and tile"
I use it when I want to create a tiled tab stack from the selected tabs – as simple as that, but saves two clicks (right click → stack + right click → tile vs right click → stack and tile).- Stack tabs
- Tile vertically
-
Chain 2
"New tiled tab"
Generally, I open a new tab as the last one, but there are some exceptions – sometimes I want to use the opened tab as a source/pattern I'm going to use e.g. to write a new forum post based on it.
Then I open a new tab, stack it with the original one and tile them.- New tab
- Delay – 100 ms
- Select previous tab
- Tile to grid
- Stack tabs
-
Chain 3
PLEN
Once upon a time I had some bookmarklets in my Opera browser. Actually, I still have them (imported from Opera), but just don't use them.
I turned one of them to a command chain. It's just a JS script:var host = window.location.hostname; var url = window.location.href; if (host.match(/pl\.wikipedia\.org$/)) { var pat = 'pl.wikipedia'; var rep = 'en.wikipedia'; } else { if (host.match(/en\.wikipedia\.org$/)) { var pat = 'en.wikipedia'; var rep = 'pl.wikipedia'; } else { var pat = url; var rep = url; } } url = url.replace(pat, rep).toString().split("#")[0]; window.location.href = url })()
Sometimes when I search something using Wikipedia in Polish and there's nothing there, I want to check if there's something in English – it's not just clicking a language change, as basically I use it when there's no language change link.
I can manually change "pl" to "en" in the address field, but using a command chain is a bit faster and a bit easier, as changes in the address field need precision while keyboard shortcuts or quick commands don't.
It goes from EN to PL as well.- Open link in current tab:
javascript:(function(){var host=window.location.hostname;var url=window.location.href;if(host.match(/pl\.wikipedia\.org$/)){var pat='pl.wikipedia';var rep='en.wikipedia';}else{if(host.match(/en\.wikipedia\.org$/)){var pat='en.wikipedia';var rep='pl.wikipedia';}else{var pat=url;var rep=url;}}url=url.replace(pat,rep).toString().split("#")[0];window.location.href=url})()
-
And finally, an idea: it would be great if it was possible to capture area to clipboard, create a new note and attach the screenshot to the note.
-
Description-
While browsing various websites, I often come across movie titles that I would like to know more about. There is always the option to highlight the text and then use a custom search engine to execute a search on IMDB, but that then requires an extra step of selecting the movie from the search results. Then I also need to find a place to watch the movie if it sounds interesting.What this command chain does is create an "I'm feeling lucky" search for movie/tv titles on IMDB and also opens the same move in
JustWatch.com
to show where it is available to watch.Why this command chain should win-
While this isn't something that gets used every day, it significantly speeds up a common task that I have to do. It isn't something for which it is worth finding or creating an extension, so a command chain is a perfect solution.In Action-
Expand for GIF
Screenshot-
Expand for image
Command Chain Text-
Movie Information
- Open Link in Current Tab
Parameter:javascript:(function()%7Bconst%20movieTitle%20%3D(window.getSelection%20%26%26%20window.getSelection())%20%7C%7C(document.getSelection%20%26%26%20document.getSelection())%20%7C%7C(document.selection%20%26%26%20document.selection.createRange%20%26%26%20document.selection.createRange().text)%3Bif%20(movieTitle%20!%3D%20%22%22)%20%7Bnavigator.clipboard.writeText(encodeURIComponent(movieTitle))%3Bwindow.open(%22https%3A%2F%2Fwww.imdb.com%22)%3B%7D%20else%20%7Balert(%22You%20need%20to%20highlight%20a%20movie%20title.%22)%3B%7D%7D)()
Pretty code
const movieTitle = (window.getSelection && window.getSelection()) || (document.getSelection && document.getSelection()) || (document.selection && document.selection.createRange && document.selection.createRange().text); if (movieTitle != "") { navigator.clipboard.writeText(encodeURIComponent(movieTitle)); window.open("https://www.imdb.com"); } else { alert("You need to highlight a movie title.");
- Delay
Parameter:2000
- Open Link in Current Tab
Paramter:javascript:(function()%7Bnavigator.clipboard.readText().then((movieTitle)%20%3D%3E%20%7Bconst%20http%20%3D%20new%20XMLHttpRequest()%3Bhttp.onreadystatechange%20%3D%20function%20()%20%7Bif%20(this.readyState%20%3D%3D%204%20%26%26%20this.status%20%3D%3D%20200)%20%7Bconst%20response%20%3D%20JSON.parse(this.responseText).d%5B0%5D%3Blet%20url%20%3D%20%22https%3A%2F%2Fwww.imdb.com%2F%22%3Bif%20(response.id.charAt(0)%20%3D%3D%3D%20%22t%22)%20%7Burl%20%2B%3D%20%22title%2F%22%20%2B%20response.id%3Bconst%20newTitle%20%3D%20response.l%20%2B%20%22%20(%22%20%2B%20response.y%20%2B%20%22)%22%3Bnavigator.clipboard.writeText(newTitle)%3B%7D%20else%20if%20(response.id.charAt(0)%20%3D%3D%3D%20%22n%22)%20%7Burl%20%2B%3D%20%22name%2F%22%20%2B%20response.id%3B%7D%20else%20%7Balert(%22Invalid%20search...%22)%3B%7Dwindow.location.href%20%3D%20url%3B%7D%7D%3Bhttp.open(%22GET%22%2C%20%22https%3A%2F%2Fv2.sg.media-imdb.com%2Fsuggestion%2F%22%20%2B%20movieTitle.charAt(0).toLowerCase()%20%2B%20%22%2F%22%20%2B%20encodeURIComponent(movieTitle)%20%2B%20%22.json%22%2C%20true)%3Bhttp.send()%3B%7D)%7D)()
Pretty code
navigator.clipboard.readText().then((movieTitle) => { const http = new XMLHttpRequest(); http.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { const response = JSON.parse(this.responseText).d[0]; let url = "https://www.imdb.com/"; if (response.id.charAt(0) === "t") { url += "title/" + response.id; const newTitle = response.l + " (" + response.y + ")"; navigator.clipboard.writeText(newTitle); } else if (response.id.charAt(0) === "n") { url += "name/" + response.id; } else { alert("Invalid search..."); } window.location.href = url; } }; http.open("GET", "https://v2.sg.media-imdb.com/suggestion/" + movieTitle.charAt(0).toLowerCase() + "/" + encodeURIComponent(movieTitle) + ".json", true); http.send(); });
- Delay
Parameter:3500
- Open Link in New Tab
Parameter:https://justwatch.com
- Delay
Parameter:3000
- Open Link in Current Tab
Parameter:javascript:(function()%7Bnavigator.clipboard.readText().then((movieTitle)%20%3D%3E%20%7Bconst%20http%20%3D%20new%20XMLHttpRequest()%3Bhttp.onreadystatechange%20%3D%20function%20()%20%7Bif%20(this.readyState%20%3D%3D%204%20%26%26%20this.status%20%3D%3D%20200)%20%7Bconst%20url%20%3D%20%22https%3A%2F%2Fwww.justwatch.com%22%20%2B%20JSON.parse(this.responseText).items%5B0%5D.full_path%3Bwindow.location.href%20%3D%20url%3B%7D%7D%3Bhttp.open(%22GET%22%2C%20%22https%3A%2F%2Fapis.justwatch.com%2Fcontent%2Ftitles%2Fen_US%2Fpopular%3Fbody%3D%257B%2522query%2522%253A%2522%22%20%2B%20encodeURIComponent(movieTitle)%20%2B%20%22%2522%257D%2526language%253Den%22%2C%20true)%3Bhttp.send()%3B%7D)%7D)()
Pretty Code
navigator.clipboard.readText().then((movieTitle) => { const http = new XMLHttpRequest(); http.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { const url = "https://www.justwatch.com" + JSON.parse(this.responseText).items[0].full_path; window.location.href = url; } }; http.open("GET", "https://apis.justwatch.com/content/titles/en_US/popular?body=%7B%22query%22%3A%22" + encodeURIComponent(movieTitle) + "%22%7D%26language%3Den", true); http.send(); });
- Delay
Parameter:100
- Select Current Tab
- Delay
Parameter:100
- Select Previous Tab
- Delay
Parameter:125
- Stack Tabs
- Tile Vertically
The delays are gratuitously large because of my spotty internet and because I need to preload the relevant website before using their internal APIs to get around CORs issues.
Love the potential of command chains! Can't wait to see how they get even more powerful!
- Open Link in Current Tab
-
Description-
There's no earthly way of knowing
In which circle we are going.
There's no knowing how long we're going
Or which color will be glowing.
Is it slowing?
Is it growing?
Is a hurricane a blowing?Not a speck of website is showing
so the chain must be slowing.
Wait, are those the fires of hell a glowing?
Does the cycle keep on flowing?
Yes! The UI must still be growing
For new colors keep on going.
And the chain is certainly not showing
any signs that they it is slowing!~Roald Dahl *(with some heavy alterations made)
Why this command chain should win-
Circle.In Action-
Circle.
Screenshot-
Circle.
Command Chain Text-
Circ... Command #10:
javascript:(function()%7Bconst%20main%20%3D%20document.getElementById(%22body%22)%3Blet%20width%20%3D%20parseInt(getComputedStyle(main).getPropertyValue(%22--width%22))%3Bif%20(isNaN(width))%20%7Bwidth%20%3D%2040%3B%7Dmain.style.setProperty(%22--width%22%2C%20width%20%2B%2010)%3Bconst%20randomColor%20%3D%20Math.floor(Math.random()%20*%2016777215).toString(16)%3Blet%20rectangle%20%3D%20document.createElement(%22div%22)%3Brectangle.id%20%3D%20%22rightSide%22%3Brectangle.style%20%3D%20%60z-index%3A%201000%3Bposition%3A%20absolute%3Bright%3A%200%3Bbottom%3A%200%3Bwidth%3A%20%24%7Bwidth%7Dpx%3Bheight%3A%20100%25%3Bbackground-color%3A%20%23%24%7BrandomColor%7D%3Bmargin%3A%20auto%3B%60%3Bmain.appendChild(rectangle)%3BsetTimeout(()%20%3D%3E%20%7Brectangle.remove()%3B%7D%2C%201000)%7D)()
Pretty code
const main = document.getElementById("body"); let width = parseInt(getComputedStyle(main).getPropertyValue("--width")); if (isNaN(width)) { width = 40; } main.style.setProperty("--width", width + 10); const randomColor = Math.floor(Math.random() * 16777215).toString(16); let rectangle = document.createElement("div"); rectangle.id = "rightSide"; rectangle.style = ` z-index: 1000; position: absolute; right: 0; bottom: 0; width: ${width}px; height: 100%; background-color: #${randomColor}; margin: auto;`; main.appendChild(rectangle); setTimeout(() => { rectangle.remove(); }, 1000);
Yes, it is not lost on me that the actual shape is a rectangle...and perhaps I stayed up a bit too late...
-
@guigirl Might be too late. Seems the entire city is already affected.
I mean look at this place. They think refrigerators and washing machines are acceptable doorways to other rooms. Also, just a few days ago, the people around here burned a giant 15.25 m (50 ft) tall marionette called Zozobra, and they do this every year...
Might as well just write-off the whole city by this point. Hopefully I can get out before the syndrome reaches its more advanced stages.
-
@nomadic Did I overlook something, or is there no cmd#14: cmd-chain, circle?
-
Very good command chain.
It follows that command chains needs to command search engines with the replace of %s with %clipboard.
That way everyone could use a simpler command:
https://www.google.com/search?ie=utf8&oe=utf8&q=site:imdb.com+%clipboard&btnI=I'm+Feeling+Lucky
-
Anyone figure out how to do CC for Delete browsing data > DELETE?
It seems we are missing chain command to TAB, SHIFT+TAB or Cycle to previous/next checkbox/button/list item... Am I wrong or I missed certain command to do these task?
-
@dude99 No keys work on the Delete Browsing Data dialog. Some navigation keys work on the Open Saved Session dialog or the Settings dialog.
I suspect it has something to do with the fact that Vivaldi creates its own dialogs.
-
@pesala We can TAB x11, or Shift+Tab x2 to highlight the Delete button, then press ENTER or SPACE to confirm.
-
Although too late for the contest I wanted to share a chain that I often use when browsing JIRA: Clone vertically
Since I haven't figured out how to post an image here, these are the stepsSelect Current Tab
Clone Selected Tabs
Select Current Tab
Select Previous Tab
Tile Vertically
Deselect TabsThat way you can e.g. edit a ticket and simultaneously view the summary of at the top of it.
You can also use the latter part of the command to ensure that "Tile vertically" only tiles the current Tab and the previous tab, even when you are using tab groups. (By default, it tiles all tabs within the tab group) -
@pyfips To insert an image here, click the last icon on the toolbar above and select the image from your PC. I do not think you need to include the commands for selecting tabs. Tile commands will automatically tile with the recent tab. Perhaps you need to enable:
Include Active Tab in Initial Selection -
@pesala: I have no toolbar in the comment section here, only a text field. Maybe this is a feature for mods?
When I created this chain in the way you are suggesting it it worked well even when the active tab was not selected explicitly.
But it did not work as intendend when a tab within a tab group was active: Then, the tab was cloned (which was fine) and the whole tab group was tiled (not only the cloned tab and the previous one) -
@pyfips Using the 4.1 Stable version without the Vivaldi Forum Extension I still see the icons on the toolbar.
I also see the unexpected result if cloning a tab within a tab stack
-
@pesala: I have the same Vivaldi version and have no forum extension, yet I do not see any toolbar (Unfortunately I cannot send a screenshot of this )
But this is a problem for another time(Interesting, on Vivaldi for Android there is a toolbar, so here you go)
-