Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript bookmarks not working anymore #3178

Closed
romgrk opened this issue Nov 2, 2018 · 13 comments · Fixed by #3437
Closed

Javascript bookmarks not working anymore #3178

romgrk opened this issue Nov 2, 2018 · 13 comments · Fixed by #3437

Comments

@romgrk
Copy link

romgrk commented Nov 2, 2018

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)()

#3167 might solve this.

gdh1995 added a commit to gdh1995/vimium-c that referenced this issue Nov 28, 2018
@shaymdev
Copy link

shaymdev commented Dec 6, 2018

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.

@wocala
Copy link

wocala commented Dec 11, 2018

+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);})();

@kevin349
Copy link

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

@ghost
Copy link

ghost commented Dec 20, 2018

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

smblott-github added a commit to smblott-github/vimium that referenced this issue Dec 27, 2018
Since `chrome.tabs.update()` no longer supports `javascript:` URLs, here
we inject them into the page itself.

Replaces philc#3167.
Replaces philc#3209.
Fixes philc#3178.
@freder
Copy link

freder commented Jan 14, 2019

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

@dvygolov
Copy link

dvygolov commented Aug 6, 2019

Guys, this is still not working?((

@cooljake777
Copy link

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

@alllex
Copy link

alllex commented Oct 10, 2019

Still does not work on 77.0.3865.90, please fix this!

@dvygolov
Copy link

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...

@gdh1995
Copy link
Contributor

gdh1995 commented Nov 25, 2019

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

@philc
Copy link
Owner

philc commented Nov 27, 2019 via email

@patkujawa-wf
Copy link

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

@philc
Copy link
Owner

philc commented Dec 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment