Follower Tabs
-
@pafflick I tested out your code as a page action before posting my reply, and the follower tab doesn't last past a refresh, hence my question about whether it would be possible to modify the code. Nevertheless, it seems more logical to me to implement the code as a page action than as a bookmarklet (simply because of the way I think of the effect of bookmarklets and and page actions).
-
@valiowk I've tested it here, prior to updating my answer and it works after refreshing the page and even after going to another page (within the tab on which the page action is activated). How is that possible that it doesn't work for you after refreshing the page?
-
@pafflick Some pages don't react that well on changes and pages and it does not work for pages that put their content in iframes originating form different domains.
-
@pafflick I tested with the "About Google", "Privacy & Terms", "Help" links at the bottom of https://translate.google.com/ , and it doesn't work for me there. Does it work for you?
-
@quhno Yes, I know the code is pretty simple, hence it's not quite versatile, as some pages may use JS to open links or use frames or use some other, less common methods of handling the links. But it should work for all the "standard" links, which are the most common.
-
@valiowk I wasn't sure when the browser executes the Page Action script - as I said, I don't really use them. It seems like the code is executed before the page finishes loading. That may be the culprit.
Try the updated code:Edit: It seems that I didn't think that through, the above code will work when you refresh the page, but obviously it won't work if executed after the page finishes loading. Code didn't work, so I removed it.
-
@pafflick Hm, now it doesn't work after the page action is first applied (clicking a link will open it in the same tab), but works after refreshing once.
-
@valiowk I think, I've got it now. Try this one:
function FollowerTabs() { var linksArr=document.getElementsByTagName("a"); for (i=0;i<linksArr.length;i++) { linksArr[i].setAttribute("target","followertab"); } } if (document.readyState==='complete') { FollowerTabs(); } else { document.addEventListener('DOMContentLoaded', function () { FollowerTabs(); }); }
-
@pafflick Works like a charm! Thanks!
-
@pafflick Sheer genius; thanks for this gem
Two questions:
- I assume each future V update will vaporise this file [hence i'll need to keep replacing it]?
- I used your code in your post to which i'm directly replying here, but i see you've been also updating your earlier post https://forum.vivaldi.net/post/243020. However they subtly disagree with each other [ignore my paths here; the actual working file is correctly in
/opt/vivaldi-snapshot/resources/vivaldi/user_files
]:
-
I'll answer you, once a new SS arrives.The new SS arrived and it indeed vaporized my file...- The difference is irrelevant - I renamed the function in my first post just because of my paranoid aesthetics (there's one "follower" tab), but it doesn't really matter which one you'll use.
-
Nice work! Well done Pafflick!
Time to submit it to the dev team for implementation -
I moved some posts from the Feature Request forum so that we don't hijack that thread any more.
-
@ornorm said in Follower Tabs:
Time to submit it to the dev team for implementation
Yeah, I was thinking about it. I mean, if they didn't hesitate to put some crazy stuff (like the Skewed Images) there, then why wouldn't they put something actually useful, like the follower tabs?
The only thing holding me back (for now) is that as a perfectionist (or just paranoid) I'd like to test this code a little bit more and make some improvements - see if I can find any solutions to some obstacles that I have already found - and to the ones that others will probably find very soon...
-
@pafflick For sure. I really know perfectionism so I truly understand. In any case, it is a present that you give to the community so you can take all the time you want!
-
@pafflick said in Follower Tabs:
I renamed the function in my first post just because of my paranoid aesthetics (there's one "follower" tab)
Additional to my earlier kudos i wanna heap more praise on you for this brilliant thing you've gifted us... AND i like it that you "tidied up" by creating this dedicated topic to keep it all "nice".
Wrt the quoted text, teehee i'm now entering into a "competition of the pedants" with you! Whilst as you rightly say "there's one "follower" tab" & "Each tab can have only one follower tab", it's also true that "You can use multiple pairs of origin-follower tabs in one session" [which i proved to myself this morning before coming back to the forum & finding you've rearranged posts & created this dedicated topic with some extra content]. Thus, pedantically, your code containing "FollowerTabs" rather than "FollowerTab" is actually semantically accurate.
Wrt your
Method 1 - Bookmarklet
This was what i actually tried [my] yesterday morning, before you'd developed the Page Actions alternative. It worked, but i decided to not persist with it for a logistic tangential reason... my Bookmark Bar is configured for "Bookmark icon only", & dragging this new bookmark to the bar results in a completely invisible BM because it has no icon. When i know it's there & point to it, it then highlights & shows tooltip, but otherwise it cannot be seen. Is there a nice way i can force it to use some icon please? [i fear this is likely a dumb question & i've forgotten some basic technique].
This is such great work you've done, @pafflick... bringing Follower TabS [heehee] into V, from our venerable grand old dame OperaPresto, transforms the way i can now browse, wrt my erstwhile decision to open multiple tabs from any single tab for subsequent reading. Lovely!
.
.
EDIT - After performing the V-SS update to 2.1.1332.4:Method 2 - Page Actions
Persistent on page refresh, not persistent through browser updatesI'll answer you, once a new SS arrives.The new SS arrived and it indeed vaporized my file...NO, not so, here. To my pleasant amazement, after i had completed the V-SS update this morning, in my file manager i saw that
/opt/vivaldi-snapshot/resources/vivaldi/user_files
continued to contain my*Follower-Tabs.js*
file! After then opening V-SS again, visually confirming it truly is the new version, then inspecting its Page Actions pop-up menu, i noted indeed thatFollower-Tabs
is still a listed option. Then i tested it again, which confirmed it remains fully functional. This explicitly implies that, for me at least, your Coding Cleverness is now a "permanent" part of my V-SS, persisting across browser updates. Possible explanations [more than one is possible simultaneously]:- You were blind drunk &/or stoned out of your mind when you earlier tested it in your V-SS.
- My stubborn inclusion of the "s" has bestowed magical anti-vaporise powers on the file.
- Linux rulz, once again!
-
@steffie said in Follower Tabs:
it's also true that "You can use multiple pairs of origin-follower tabs in one session" (...) Thus, pedantically, your code containing "FollowerTabs" rather than "FollowerTab" is actually semantically accurate.
Yeah, depends on how you look at it. Still, when you call the page actions, by pressing the "Follower Tab" checkbox you create just a single follower tab (even if you have some opened already). So, each time the script is executed, it results in creating just one tab. Ofc, for the script itself, it doesn't matter if you name it "Steven" or whatever you think is more appropriate in your opinion (except for the reserved words).
@steffie said in Follower Tabs:
Is there a nice way i can force it to use some icon please?
You know - that is actually a good question. I use my bookmarks bar only when I need it (which is almost never) and I configured it so that it contains only some bookmarklets (various JavaScript actions) and links to internal pages. I depend solely on the bookmarklet's names and I didn't even think about a good alternative for people who use only icons.
Unfortunately, there doesn't seem to be a way to do that in Vivaldi (apart from modifying the browser or the
Bookmarks
file). I found this solution for Google Chrome, but since Vivaldi doesn't import bookmarks icons (even though it exports them), it just didn't work.@steffie said in Follower Tabs:
open multiple tabs from any single tab
I don't think it works like that... Or did I miss something in your explanation?
@steffie said in Follower Tabs:
in my file manager i saw that
/opt/vivaldi-snapshot/resources/vivaldi/user_files
continued to contain my*Follower-Tabs.js*
file!Is that the actual path of your Vivaldi installation? Mine contains Vivaldi's version number, so obviously it changes on each update...
@steffie said in Follower Tabs:
- You were blind drunk &/or stoned out of your mind when you earlier tested it in your V-SS.
- My stubborn inclusion of the "s" has bestowed magical anti-vaporise powers on the file.
- Linux rulz, once again!
... and I'm pretty sure it vanished; I had the file opened in a text editor and once the update was installed, I couldn't save the file anymore (because it was deleted). I've checked the new path and the file was not there either.
So, it's not the 1st one (I get drunk/stoned just as often as I hang out with Rob Swire*), not the 2nd one (because the
s
is irrelevant) and most definitely not the 3rd one (which is obviously an invalid statement).Well then, I'm really sorry to break it to you, but the only option left is the inevitable truth, that it's just a Linux bug. Yep. Definitely a Linux bug. Like totally. Linux bug confirmed.
* I've never met him
-
Some test data for you.
If you tell me that Windoze unhelpfully vaporises that file every time V updates, i believe you. I have no idea how Macs respond in that scenario. However i can now confidently assure you that based on my testing today & t'other day, Linux behaves in a much more sophisticated & user-supportive way... Linux Vivaldi updates do NOT vaporise that file.
Or did I miss something in your explanation?
Yes you did. I was alluding to my historical mode of browsing, eg, Guardian... i review the home page, & middle-click on every article of interest as i work my way down the page, then later i change to each of those many tabs so-opened, & read each article then close its tab, one by one.
Is that the actual path of your Vivaldi installation?
Yep, but not just mine, that's how it will be for any Linux Vivaldi installation [at least, if they follow the same installation pattern as all my distros do].
Mine contains Vivaldi's version number
Must be a Windoze thing... it is not universal across all platforms, as i have shown you.
most definitely not the 3rd one
Haha, dream on!
-
@gwen-dragon I deleted the first attempt [copied & pasted from my spreadsheet into forum codeblock] coz all its columnar formatting was lost so it was hard to understand. Now it's just a picture, but at least it can be easily understood.
-
@steffie said in Follower Tabs:
I have no idea how Macs respond in that scenario.
Surprisingly, these kind of mods (as page actions) survive an update, j'en suis ébahi (= I'm astounded). I'm using another one, it's still here, though I updated V after installing it.