Command Chain Recipes
-
@luetage thanks a lot for the feedback. I agree being able to use existing search engines is a real benefit.
Since I only use a handful of engines it’s still ok to setup for me.I hate the corrupted URL…didn’t realize it before you mentioned it.
Seems like Vivaldi opens the script in the current TAB therefore putting the script in the address bar and run it from there.
There would be a simple solution by just using “open link in new tab” as Vivaldi command and changing the javascript/parameter to open in same tab.
But it seems like you can’t run any javascript function with the “open link in new tab” command. All it does is opening a new empty tab.
E.G.: Open link in new tab > Parameter: javascript:window.open("https://www.youraddress.com", "_self") only opens an empty tab for me..Not sure if this is a bug or missing feature but I reported both issues as bug.
-add support for javascript in "open in new tab" command chains VB-82849
-add command type "run javascript" to be able to run scripts in background without address bar, just like clicking a bookmarklet. VB-82850BTW...not sure if any admins read this but the request feature site misses a command chain category.
-
Only an ordinary History Panel
1, History Panel
2, Select All -
@shifte Is the better version of the existing command!
-
New Tab Position: As First Tab
1, New Tab
2, Delay
parameter: 100
3, Pin/Unpin tab
4, Pin/Unpin tabI don't use "Ctrl+t" at all, but...I got an idea.
-
New Stacked Tab
I set this chain to Ctrl+T to always puts the new tab in a stack, either in the existing stack or in a newly created stack if the active tab was a top-level tab. "New Tab" and "New Top Level Tab" already exist as keyboard shortcuts. However, the "New Tab" command has different behavior depending on whether the active tab is a new top-level tab, or already part of a stack.
Change Settings:
- Settings > Tabs > New Tab Position:
After Active Tab
Chain:
- New Tab
- Delay
Parameter:100
- Select Previous Tab
- Stack Tabs
Note it does have some disadvantages. Maybe you guys can find a better workaround? Also see this post and that post.
- Have to set "After Active Tab" in settings, which undesirably changes "New Top Level Tab" command behavior.
- Slows down the entire browser a bit by adding delay to every new tab opening.
- Causes some visually distracting flashing in the tab bar as the chain selects tabs and re-groups them.
- Doesn't change how bookmarks open, as OP notes in that post.
New Top Level Tab at End
The "After Active Tab" setting changes the "New Top Level Tab" command behavior, but with Vivaldi v5.1 we can now restore the desired behavior (albeit with some visually distracting motion in the tab bar). And note this still doesn't fix how bookmarks open.
Chain:
- New Top Level Tab
- Move Tabs to End
- Settings > Tabs > New Tab Position:
-
@ukanuk If you enable:
Include Active Tab in Initial Selection- New Tab
- Stack Tabs
Should stack the new tab with the current tab without any delay, and whatever the new tab position.
-
@Pesala , I only see that option under "Tabs > Tab Features > Tab Selection". Do you see it in a second place? In any case, it was already enabled for all my testing.
Without changing the "New Tab Position" setting, I found that Vivaldi stacks the new tab with whatever tab is to its left -- "Previous" tab apparently means the one to the left of the current tab, not the previous one by recent order.
Without the delay, I found that Vivaldi actually stacked the Previous Tab with the second previous tab -- the just-newly-created tab apparently doesn't appear quite quickly enough to be included as part of the initial selection.
-
New chain Open Selection
This used to be »Search Engine with Selection«. In an update a while ago we got the ability to search any engine with parameter, which made this previous chain obsolete. The difference to the inbuilt command »Search with Selection« is being able to open addresses which aren’t hyperlinks.
@ukanuk If you’re happy with your chain, we can include it. I have to admit I forgot about it after seeing it initially.
-
@luetage Yep, I've been using my chain as-is for a month now and don't see anything changing until/unless Vivaldi changes stuff.
-
Figure out the publish date of an article (if hidden):
Open link in current tab with-----> javascript:window.open("https://www.google.com/search?q=inurl:"+encodeURIComponent(location.href)+" "+('&as_qdr=y15'))
This script will search the link on Google, from 15 years ago. The date appears on Google.
-
@aperrizio Nice idea, included.
-
@luetage I discovered that there is no need to define a variable when "restoring" the URL. I believe that adding a delay is not necessary either. Changing the URL with
replaceState
shouldn't affect the execution of the code. If anything, it's added at the end, so it should be the last thing to execute anyway.
For example, I changed this (from your "Dark (Invert)" snippet):
setTimeout(()=>{const t=window.location.href;window.history.replaceState("stateObj","",t)},300)
into:
history.replaceState({},"",location.href)
and it works just as well (or slightly better, since the change of the URL is almost unnoticeable). -
@pafflick Can’t recall why I introduced a timeout, it’s been too long. But great if it continues to work for you without it.
-
@luetage, I added a new chain to my previous post. My old "New Stacked Tab" chain required changing a setting that adversely affected "New Top Level Tab" behavior, and my new command "New Top Level Tab at End" functionally restores the desired behavior using new v5.1 commands.
-
Thought I'd cross-post this here (from the Copy from adress bar in a formated way (like on MS Edge) feature request thread):
Copy the current page's URL & title as a rich text
(eg. copy Home | Vivaldi Forum instead of
https://forum.vivaldi.net
)Command 1:
Open Link in Current Tab
Command Parameter:javascript:function copy(c){c.clipboardData.setData('text/html','<a href="'+location.href+'">'+document.title+'</a>');c.preventDefault();}document.addEventListener("copy",copy);document.execCommand("copy");document.removeEventListener("copy",copy);history.replaceState({},"",location.href);
-
Welp, the latest snapshot just broke this chain, although this gives me hope
Now working again as intended
Save Tab Stack as session:
Command 1: Deselect Tabs
Command 2: Select Current Tab
Command 3: Save Selected Tabs as SessionHow I use the chain
I set this chain to Ctrl+S, save all to Ctrl+Shift+S, and open saved session to Ctrl+O.
When I have a project I want to close and come back to, all I need to do is Ctrl+S, Space [or a descriptive name I guess ], Enter, Ctrl+W.
-
@legobuilder26 @ukanuk @pafflick Nice ideas, added all of them to OP now.
@pafflick I added your chain, but it doesn’t work for me, it makes no new entry in clipboard. Hard to tell why, looks ok to me. But I’d assume people could run into issues in certain circumstances. Beats me. Other chains that copy to clipboard work fine.
-
-
@pafflick This works.
-
@luetage any errors in the console? Does it work when you execute it through the console?