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.