Command Chain Recipes
-
@mikeyb2001 See ☛ https://forum.vivaldi.net/post/717847. It’s already linked from the first post.
-
@luetage woops didnt remember sharing that already
-
@luetage here i am thinking im being helpful and im either skipping steps or repeating myself wth is wrong with me
-
@mikeyb2001 Getting old?
-
@Pesala 33 thank you very much. Not that old
-
Tile Link (with keyboard shortcut)
We can do this from the right-click menu with a native parameter (
{link_url}
). When using a keyboard shortcut to trigger the chain, a bookmarklet is needed. Hover with the mouse cursor over a link and use a keyboard shortcut to execute (or open quick commands and execute the command chain from there). The delay might have to be adjusted depending on usage. 1000msshould be safe, but on some pages it might need more.
- Open Link in Current Tab
Parameter:javascript:(()=>{const hover=document.querySelectorAll(":hover");for(let i=hover.length-1;i>=0;i-=1){if(hover[i].hasAttribute("href")){window.open(hover[i].href,"_blank");return}}history.replaceState({},"",location.href)})();
- Delay
Parameter:1000
- Tile to Grid
{"category":"CATEGORY_COMMAND_CHAIN","chain":[{"defaultValue":"https://vivaldi.com","key":"0b01337b-4c13-4197-90c8-179c5c91cfff","label":"Open Link in Current Tab","name":"COMMAND_OPEN_LINK_CURRENT","param":"javascript:(()=>{const hover=document.querySelectorAll(\":hover\");for(let i=hover.length-1;i>=0;i-=1){if(hover[i].hasAttribute(\"href\")){window.open(hover[i].href,\"_blank\");return}}history.replaceState({},\"\",location.href)})();"},{"defaultValue":1000,"key":"2eb81004-6703-46db-9933-6afcfde924e4","label":"Delay","name":"COMMAND_CHAINED_SLEEP","param":1000},{"key":"83c2d2d0-a53b-4521-82b5-4c2e61ed024b","label":"Tile to Grid","name":"COMMAND_TAB_STACK_TILE_GRID"}],"key":"7bf717f6-b441-4a48-8094-ab3dd683a7a5","label":"Tile Link","name":"COMMAND_7bf717f6-b441-4a48-8094-ab3dd683a7a5"}
- Open Link in Current Tab
-
Is it possible to send keys in a Command Chain?
Like this in AHK (or a number):
Send, {LButton}
-
I remind you of this question.
-
@barbudo2005 lol, sorry. No, I can’t think of a way right now. You can simulate key and mouse events through Javascript and you can obviously give that a try, it’s not complicated, but I think it’s deemed insecure and therefore won’t work from a bookmarklet.
-
Share Current Page with OS Share Menu
This command chain makes it easier to share a link with additional details (when supported). It will pull the current tab's URL, title, and
og:description
( a short description of the webpage's contents that page owners can choose to provide) and pass them to the OS' share dialog that can redirect you to various apps and websites where you might want to share the link.Command Chain:
- Open Link in Current Tab
Parameter:javascript:(()=>{if(navigator.share){navigator.share({title:document.title,text:document.querySelector('meta[property="og:description"]')?.content,url:location.href}).then(()=>{history.replaceState({},"",location.href)})}})();
- Open Link in Current Tab
-
Notice for Linux users, who would want to give this command chain a try:
navigator.share
doesn’t work on Chromium yet, therefore it won’t do anything. -
@erazer101 Thanks for the HotkeyHighlightSearch command chain, very useful. Am I right when I say a single key shortcut, instead of a "normal shortcut like
CTRL+Q
, does not work? -
@luetage Thanks for the DeepL command chain.
You also stated:
command chains have replaced bookmarklets
I have a bookmarklet that kills so-called stickies on a webpage, like a pop-up at the bottom of the page.
I don't know which command to use for that. This is the parameter:
javascript:(function%20()%20{%20var%20i,%20elements%20=%20document.querySelectorAll('body%20*');%20%20for%20(i%20=%200;%20i%20<%20elements.length;%20i++)%20{%20if%20([%22sticky%22,%20%22fixed%22].includes(getComputedStyle(elements[i]).position))%20{%20elements[i].parentNode.removeChild(elements[i]);%20}%20}%20})();
-
@luetage re your command chain Copy Page Address, can you tell me where to add the code?
I ask because after command 6, Focus Page, there is no box to add the code.
-
@Granite1 said in Command Chain Recipes:
after command 6, Focus Page, there is no box to add the code.
The stuff in
{ }
brackets at the end of these posts is a repeat of the steps listed above them, but in a form you can directly import into Vivaldi if you use a JS mod that adds that functionality.See this section of the first post in the thread:
@luetage said in Command Chain Recipes:Backup and Share
Command Chains are not part of Vivaldi Sync. This means we lose our chains when we setup a new profile, or create a separate installation. Inputting everything again is tiresome, especially with a big chain collection. Fortunately @tam710562 has created a custom modification, which can both import and export command chains from and to files and the clipboard. This makes it possible to share chains directly, because he has even coded a direct install button for command chains shared on the forum. It’s definitely worth it and a big help and I would urge you to try it out, even if you haven’t bothered with Javascript modifications before. Here a link to the modification ☛ https://forum.vivaldi.net/post/723047, and here a link to the modifications forum board ☛ https://forum.vivaldi.net/category/52/modifications. Read pinned topics for introduction and help.
-
@nomadic said in Command Chain Recipes:
The stuff in { } brackets at the end of these posts
Many thanks for that explanation. The 6 steps work, I have not tried the JS side.
-
@Granite1 Bookmarklets are bookmarks containing Javascript code. They have to be opened in the same tab to work on the page. Therefore the command would be “open link in current tab” and the parameter is your script. It replaces the URL.
-
Therefore the command would be “open link in current tab” and the parameter is your script.
Yep, that works fine. Thanks for your help.
-
This post is deleted! -