Would like alternative bookmarklet to search site.
danielson last edited by A Former User
Have used this Google based bookmarklet to search a specific site and have managed (with the help of a Donation Coder Forum member) to use another (such as Presearch for example) instead. It works fine on all other browsers (Edge, Firefox, Slimjet, Opera...) except for Vivaldi.
Any other options?
@danielson I can confirm it does work in Opera but not in Vivaldi. No clue as to why though. Feel free to report a bug but I wouldn't get my hopes up it will be fixed quickly, I don't think their priorities are on making bookmarklets work perfectly.
My JS skills are not good enough to figure out another way to do what you want here.
@danielson Bookmarklet works for me. Make sure to open it in the same tab. You are also posting on the wrong forum board, this belongs in help and support, it’s not a Vivaldi UI modification.
@luetage It works for you? That's weird... I tried different variants, replacing the
"and so on.
@pathduck Yes, starts a google search with selection.
- Copy bookmarklet
- Select something
- Paste bookmarklet in address field and open in same tab.
@luetage Hmmm.... it works for me if I remove the regex replace part
EDIT: It does work if I just paste it into the URLbar. But as a bookmarklet, Vivaldi stupidly replaces
/so the regex fails:
@pathduck lol, good find
Might be worth a bugreport.
@luetage Yeah, I guess... Bookmarklets in Vivaldi has always been kind of buggy. They should improve it, some people (me included) still rely on some of them, although mine are a lot simpler than this one.
There's a lot of URL encoding in this, making it really hard to figure out. It should be reduced to the bare minimum to work first. It probably doesn't even need that regex...
Bookmarklets should always be posted as code blocks to avoid wrapping causing even more
%20's in the code.
Bare minimum with regex (won't work as bookmarklet):
Without regex, should work except for edge cases like strings containing
+where you want the plus to actually be in the search query:
Doesn't really need the
void(0)at the end, maybe it's there for weird JS compatibility reasons?
And I really have no idea why it needs that
""at the start, do you @luetage ?
@pathduck It’s funny you’d think I could code. What gave you that impression? I’m just faking it.
Lets say it’s an empty string to warm up the code, raising body temperature and increasing blood flow.
@pathduck Don’t you dare animal shaming me, you
@luetage We can still be fwends
Bug reported as
It's not just in my head!
@luetage - not sure why this should be posted elsewhere since it is after all a "tweak" of sorts isn't it?
- not sure i understand your tip about opening tab...
Oh and I figured out what the
""at the start is good for, after a lot of head-scratching. It's a "hack" to force the value of
qto a string, as apparently
So the same could be accomplished by simply:
Can you lay out the full JS now "Master"?!
@danielson Yeah this is the basic working bookmarklet code without all the (IMO) unnecessary URL-encoding and without the regex that breaks in Vivaldi:
I find when it comes to bookmarklets, following the KISS principle is essential.
@pathduck - you're the dude man!!
Just tried it with Presearch and it works flabergastingly well!
Thanks a bunch!
Will post at DonationCoder Forum - you might want to visit there if ever looking for a job...
@danielson Glad to hear that. It's a useful little bookmarklet, might even keep it around now that I understand what it does
I did find the thread on the DonationCoder forum, the other user said it worked for them in V 2.9 - but that's because the regex replace bug wasn't there then. It seems to have been introduced later, maybe in 3.0.
But it should work just fine without the replace function anyway
Hopefully V team will fix the bug as well.
Well, at least it can be of use to you!
Have been using the Google based one for years now. Discovered it once upon a time, on a site called Fark.
Just nice to be able to use something now, that doesn't have Alphabet's nose involved. At least, i like to think it's not...