Giter Site home page Giter Site logo

kaligula0 / bookmark-iconizer Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 1.0 66 KB

Chrome browser extension for setting icons for bookmarks which came without it

Home Page: https://chrome.google.com/webstore/detail/bookmark-iconizer/hbnmehpggmbpiackncinpnlgkgbgmpjk

License: GNU Affero General Public License v3.0

CSS 8.85% HTML 46.88% JavaScript 44.28%

bookmark-iconizer's People

Contributors

dragonish avatar kaligula0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dragonish

bookmark-iconizer's Issues

Extension doesn't work with this JS bookmarklet

I have this bookmarklet to convert a DuckDuckGo search to a Google search using DDG bang syntax (I'm using jQuery $ since it's loaded on the page):

javascript:(function(){if(!window.location.origin.includes('duckduckgo.com'))return;f=$('search_form');i=$('#search_form_input');i.val('!g '+i.val());f.submit()})()

Trying to add a favicon with this extension produces the following bookmarks.html

<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
     It will be read and overwritten.
     DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
	<DT><A HREF="javascript:(function(){if(!window.location.origin.includes('duckduckgo.com'))return;f=$('search_form');i=$('

Somewhere in the code, it's treating the # as a comment delimiter and ignoring everything after it.

Doesn't' work on bookmarklets.

What steps will reproduce the problem?

1. Try to change a bookmarklet's icon.
2. It accepts the base64 URL and appears to accept it. 


What is the expected output? What do you see instead?

When you reload the options page and search for the same bookmark(s) it has no 
favicon and the actual bookmarklet on my bookmarks bar has not changed.

What version of the product are you using? On what operating system?
Version: 1.5.1 on MS Windows XP.

Original issue reported on code.google.com by [email protected] on 1 Dec 2013 at 3:26

Attachments:

Won't update icon

I was able to change one icon once, then when I didn't like the icon, have been unable to change it since. The other bookmark I wanted to update had no icon, and I have not been able to attach one.

[bug] If the bookmarklet contains double quotes, then after importing, the icons work fine, but the bookmarklet don't work.

win10 x64
chrome version 122.0.6261.95 (Official Build) (64-bit)
I'm using the latest version(1.7.3) of bookmark-iconizer

For example the darkthemeswitcher bookmarklet:

javascript:(d=>{var css=`:root{background-color:#fefefe;filter:invert(100%)}*{background-color:inherit}img:not([src*=".svg"]),video{filter: invert(100%)}`,style,id="dark-theme-snippet",ee=d.getElementById(id);if(null!=ee)ee.parentNode.removeChild(ee);else {style = d.createElement('style');style.type="text/css";style.id=id;if(style.styleSheet)style.styleSheet.cssText=css;else style.appendChild(d.createTextNode(css));(d.head||d.querySelector('head')).appendChild(style)}})(document)

Click on this bookmarklet to toggle between bright mode and dark mode of the site
Source: https://gist.github.com/frontdevops/8aea1e0252dd826488dad63319e3ec88

Followed the extension step by step and it was all good in the end, the name of the html I exported in step 3 was the test.html and then imported it in chrome's bookmark manager.

I found that the icon became a customized icon, but the js bookmarklet didn't work.

Then I opened test.html and found the following code:

<H1>Bookmarks</H1>
<DL><p>
	<DT><A HREF="javascript:(d=>{var css=`:root{background-color:#fefefe;filter:invert(100%)}*{background-color:inherit}img:not([src*=".svg"]),video{filter: invert(100%)}`,style,id="dark-theme-snippet",ee=d.getElementById(id);if(null!=ee)ee.parentNode.removeChild(ee);else {style = d.createElement('style');style.type="text/css";style.id=id;if(style.styleSheet)style.styleSheet.cssText=css;else style.appendChild(d.createTextNode(css));(d.head||d.querySelector('head')).appendChild(style)}})(document)" ADD_DATE="1709539209" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACHUlEQVR42pWTzWsTURTFz3xk0gxVCpWCRF1IVSioVBCpKRUXdeFKF925DSou0q5UqLooaJYiqEtRt/4Bgii22WsRtNVsWkraNDCZTCaZ73nXO52FikScgQv38d753fPufSPhH19+ySSVBPr3R6VBZwZuqAsGnTwtodcn1G9lBVQMmiupuDxVwOIbG42FLID5Nl2ZVvDy6j68Wg8x/9pCXB37T8Adk66VFFRnh1E3Bd63ItS+BZEXkBoQIQg4XIHIJUAG2j/s3wD3LLoxo2Lpgo6VHRYaAhCES0UFQwrB8AhWRGgH3NQI+GwC715spQDpoU2VkozFKR3LzRirZoyYxW2fIMcENxboct7jcBKAm4Ak7C63IO1/2qW75zWUJ/L4yOK1XoyIRTYfttiy5Ql0uLrLucv2E4jrCISygs7KNqQDz216NKvh7GgOb5sRQrbZ40gqdn3BFXkdstBhYeKAgQ478GMZVm0zvcJw1aLyTA6nihrqRgw7SiuxGfQDcJ7advxU7LEjj/ft2savJuoP2jQ3reH4YQ0b3IMEYJku3JBzDseX4PCj8pyYxQJ+yOtPzT/HWLht0MVzMo4d1dHoCGytNdHa9KDqBQROBDazN8qI4cyEaPp/P6Shyi5NnslhfELH91UL619tdB+PZ3vK+Zs7dGJSw8iYgi8fuug8OZL9Z9Kvb9PIQbbrAa1qMTtg7zrlBqk5nsazQwPP/QQwKkexzEJveQAAAABJRU5ErkJggg==">test</A>
</DL><p>

Watch this line:
<A HREF="javascript:……[src*=".svg"]……(document)" ADD_DATE="1709519824" ICON="……">test

I found that the double quotes in the exported html are still not encoded successfully, the HREF attribute has a double quote, and inside the HREF attribute , there are two more double quotes: src*=".svg" , the two double quotes cause a conflict and make the script not work.

Results in duplicate bookmarks

the old bookmark remains, when the new bookmark is imported.
they BOTH get iconized.
it's a minor convenience issue (must manually delete one of them).

an improvement would be:

  • auto-delete the old one
    or
  • don't import the new bookmark-- just apply the base64 image to the existing bookmark.

thx!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.