Vimium: Javascript bookmarks not working anymore

Created on 2 Nov 2018  Â·  13Comments  Â·  Source: philc/vimium

My javascript bookmark use to work on Chrome 69, but it doesn't on version 71.0.3578.30.

Its content is:
javascript:(function()%7B(function () %7Bvar i%2C elements %3D document.querySelectorAll('body *')%3Bfor (i %3D 0%3B i < elements.length%3B i%2B%2B) %7Bif (getComputedStyle(elements%5Bi%5D).position %3D%3D%3D 'fixed'||getComputedStyle(elements%5Bi%5D).position %3D%3D%3D 'sticky') %7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)()

https://github.com/philc/vimium/pull/3167 might solve this.

Most helpful comment

looks like there is a fix. any chance this will be merged/released soon?

All 13 comments

I use javascript bookmarklets all the time from the vomnibox and have really been missing them over the last little while. Here's to hoping the great minds can figure it out.

+1 here. Chrome V70 works, V71 fails.
Failed to open javascript via Vomnibar.activateBookmarks and Vomnibar.activateBookmarksInNewTab
only clicking the bookmarklet works.

My javascript is (case-sensitive Find):
javascript:(function(){var text=prompt('Search for:','');if(text==null || text.length==0)return;var spans=document.getElementsByClassName('labnol');if(spans){for(var i=0;i < spans.length;i++){spans[i].style.backgroundColor='transparent';}}function searchWithinNode(node,te,len){var pos,skip,spannode,middlebit,endbit,middleclone;skip=0;if(node.nodeType==3){pos=node.data.indexOf(te);if(pos>=0){spannode=document.createElement('span');spannode.setAttribute('class','labnol');spannode.style.backgroundColor='red';middlebit=node.splitText(pos);endbit=middlebit.splitText(len);middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);skip=1;}}else if(node.nodeType==1 && node.childNodes && node.tagName.toUpperCase()!='SCRIPT' && node.tagName.toUpperCase !='STYLE'){if(node.tagName.toUpperCase() == "IFRAME"){ node = node.contentWindow.document.body; }for(var child=0;child < node.childNodes.length;++child){child=child+searchWithinNode(node.childNodes[child],te,len);}}return skip;}searchWithinNode(document.body,text,text.length);})();

+1 to it not working on Chrome V71. Scriptlet works if I copy directly into the console or manually click.

Been running into the same problem lately. Seems to have started being an issue only a couple days ago.

looks like there is a fix. any chance this will be merged/released soon?

Guys, this is still not working?((

Still not working in 76.0.3809.100. Very frustrating. You have to click on another bookmark first then it works. See also: https://support.google.com/chrome/thread/3959468?hl=en

Still does not work on 77.0.3865.90, please fix this!

Guys, if there is a fix, why don't you merge it? This thing drives me nuts( I've got a couple of great js-bookmarks, that help me automate my work, and this feature could boost my productivity a lot...

@philc Could you merge #3437 to fix this issue? I've tested it and it works well.

Dahan thanks for the bump and the PR. I'll merge it this weekend!

On Sun, Nov 24, 2019 at 7:41 PM, Dahan Gong < [email protected] > wrote:

@ philc ( https://github.com/philc ) Could you merge #3437 (
https://github.com/philc/vimium/pull/3437 ) to fix this issue? I've tested
it and it works well.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub (
https://github.com/philc/vimium/issues/3178?email_source=notifications&email_token=AAACDFUW76NG5GPQYXHRRP3QVNCNHA5CNFSM4GBRMUDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFA75IA#issuecomment-557973152
) , or unsubscribe (
https://github.com/notifications/unsubscribe-auth/AAACDFXXB2SLPVKEKK6NPWTQVNCNHANCNFSM4GBRMUDA
).

It doesn't look like it was merged, or am I missing something? Thanks guys!

Sorry for the delay folks. I've merged the fix from @gdh1995 but haven't released a new version to the chrome store. I'll batch a few more changes together in the next week and create a new release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peter099 picture peter099  Â·  3Comments

finalfantasia picture finalfantasia  Â·  3Comments

bartlibert picture bartlibert  Â·  4Comments

Poseiden picture Poseiden  Â·  3Comments

haroldcarr picture haroldcarr  Â·  4Comments