TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Bookmarklets I Use

228 点作者 adminu将近 5 年前

31 条评论

paol将近 5 年前
&quot;Remove sticky&quot; is a must have on the modern web. Probably my most used bookmarklet.<p>A couple of others I use frequently:<p>Go to referrer. This fixes an infuriating missing feature in browsers, where links opened in new tabs lose their history (why?). Often this workaround will work:<p><pre><code> javascript:if(!document.referrer)%20alert(%22No%20referrer!%22);%20else%20document.location%20=%20document.referrer;%20void%200 </code></pre> Open in wayback machine. For when you follow a link and there&#x27;s nothing there anymore.<p><pre><code> javascript:{var%20url=location.href;void(window.open(&quot;http:&#x2F;&#x2F;wayback.archive.org&#x2F;web&#x2F;*&#x2F;&quot;+url));}</code></pre>
评论 #23449495 未加载
评论 #23449329 未加载
评论 #23446596 未加载
chrismorgan将近 5 年前
There’s a fun way around <i>that specific</i> “remove sticky” bookmarklet, because it only looks at elements within the body. But did you know: you can actually show content from the head! For example, you could display the document title and make it sticky:<p><pre><code> head, title { display: block; position: sticky; top: 0; left: 0; right: 0; } </code></pre> An example of using this technique (minus stickyness) in real life (for some loose value of “real life”): <a href="https:&#x2F;&#x2F;github.com&#x2F;martenbjork&#x2F;github-xp&#x2F;issues&#x2F;13" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;martenbjork&#x2F;github-xp&#x2F;issues&#x2F;13</a><p>You can apply this technique to &lt;script&gt; and &lt;style&gt; content as well to get other text nodes that are normally hidden to appear on-screen. You could also use ::before and ::after psuedoelements on other elements (and for bonus marks remember you can use attr() within their content). But no regular formatting within the head. Well, unless you append the nodes to the head with JavaScript. Yeah, the DOM lets you create nominally illegal structures that can’t be serialised again.
评论 #23451715 未加载
chrismorgan将近 5 年前
On the video faster&#x2F;slower playback thing: it would be better for the slower link to multiply by 0.8 rather than 0.75, so that it’s the opposite of faster. Currently each time you click faster once and slower once, you end up at 93.75% speed rather than 100%.
sixhobbits将近 5 年前
I was kind of impressed by Spritz[0] speed reader a few years ago when I tried it. Fun to see their entire(?) business which raised over $4 million[1] in VC replaced by a JavaScript booklet.<p>[0] <a href="https:&#x2F;&#x2F;spritz.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;spritz.com&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;www.crunchbase.com&#x2F;organization&#x2F;spritz#section-overview" rel="nofollow">https:&#x2F;&#x2F;www.crunchbase.com&#x2F;organization&#x2F;spritz#section-overv...</a>
评论 #23448258 未加载
评论 #23448473 未加载
评论 #23448076 未加载
评论 #23450697 未加载
aaronpkelly将近 5 年前
I use this bookmarklet to collapse all the top comment threads on a hacker news story. I usually do this for stories where there&#x27;s a lot of threads, and use the currently open thread is my &quot;bookmark&quot;. It collapses 1 thread a second (any faster and the toggle request may not succeed):<p><pre><code> javascript: var TIMER_WAIT = 1000; var timer = 0; var topComment = []; var list = document.getElementsByClassName(&#x27;togg&#x27;); for (let item of list) { if (item.parentElement.parentElement.parentElement.parentElement.getElementsByTagName(&#x27;img&#x27;)[0].width == 0) topComment.push(item) }; for (let item of topComment) { setTimeout(() =&gt; { console.log(&quot;toggling comment by &quot; + item.parentNode.getElementsByClassName(&#x27;hnuser&#x27;)[0].innerText); item.click(); }, timer + TIMER_WAIT); timer = timer + TIMER_WAIT; }</code></pre>
bharani_m将近 5 年前
Thanks for sharing this great collection. I&#x27;ve just added your &#x27;remove sticky&#x27; bookmarklet.<p>In case anyone is wondering, bookmarklets also work on mobile devices. You can simply go to the address bar and type the name of the bookmarklet (e.g.: &#x27;remove sticky&#x27;) and then click the option that shows up in the list.<p>Adding them to your mobile browser is a bit tricky though. I&#x27;ve written a small guide that helps users of my app [0] add my bookmarklet to Android&#x2F;iOS devices. You can follow these steps&#x2F;screenshots to add other bookmarklets - <a href="https:&#x2F;&#x2F;www.emailthis.me&#x2F;web-page-to-email&#x2F;how-to-save#android-mobile-tablet" rel="nofollow">https:&#x2F;&#x2F;www.emailthis.me&#x2F;web-page-to-email&#x2F;how-to-save#andro...</a><p>[0] <a href="https:&#x2F;&#x2F;www.emailthis.me" rel="nofollow">https:&#x2F;&#x2F;www.emailthis.me</a>
评论 #23446755 未加载
notRobot将近 5 年前
I love bookmarklets. There are many fantastic ones here: <a href="https:&#x2F;&#x2F;www.squarefree.com&#x2F;bookmarklets&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.squarefree.com&#x2F;bookmarklets&#x2F;</a><p>They haven&#x27;t been updated in a while but they work perfectly in latest FF (and Chrome I suppose).
joosters将近 5 年前
Can any Firefox experts help me out with a bookmarklet, please?<p>A HN comment a while ago reported that you can switch to the &#x27;reader mode&#x27; view of a website by prefixing the URL with &#x27;about:reader?url=&#x27; - this can be useful for some pages where FF doesn&#x27;t put the &#x27;reader mode&#x27; button in the URL bar.<p>This seemed like an ideal use for a bookmarklet, so I created one as follows:<p><pre><code> javascript:(function(){ window.location = &quot;about:reader?url=&quot; + window.location; })() </code></pre> But, this doesn&#x27;t work. In the console I get the error:<p>TypeError: Location.href setter: Access to &#x27;about:reader?url=<a href="https:&#x2F;&#x2F;www.example.com&#x2F;&#x27;" rel="nofollow">https:&#x2F;&#x2F;www.example.com&#x2F;&#x27;</a> from script denied.<p>Is there any way to work around this, or do bookmarklets simply not have the permissions to alter the URL like this?
评论 #23446573 未加载
评论 #23449804 未加载
评论 #23447162 未加载
评论 #23453681 未加载
owenversteeg将近 5 年前
Bookmarklets are wonderful! I will certainly use that &quot;remove sticky&quot;. My favorites:<p>Add jQuery to any page:<p><pre><code> void((function(doc){if(typeof jQuery==&#x27;undefined&#x27;){var script_jQuery=document.createElement(&#x27;script&#x27;);script_jQuery.setAttribute(&#x27;src&#x27;,&#x27;&#x2F;&#x2F;code.jquery.com&#x2F;jquery-latest.min.js&#x27;);document.body.appendChild(script_jQuery);console.log(&#x27;jQuery added&#x27;);}else{console.log(&#x27;jQuery already included&#x27;);}})(document)); </code></pre> Edit any page:<p><pre><code> javascript:document.body.contentEditable = true; void 0; </code></pre> Make the right click work again:<p><pre><code> javascript:void(document.onmousedown=&#x27;return true&#x27;);void(document.onmouseup=&#x27;return true&#x27;);void(document.oncontextmenu=&#x27;return true&#x27;)</code></pre>
rasz将近 5 年前
improved &#x27;remove sticky&#x27;, some websites set overflow on BODY element itself, or get cute with whole document class, this will catch those.<p><pre><code> javascript: (function() { void([].forEach.call(document.querySelectorAll(&#x27;body*&#x27;), e =&gt; &#x2F;fixed|sticky&#x2F;.test(getComputedStyle(e).position) &amp;&amp; e.parentNode.removeChild(e))); document.body.style.overflow = &#x27;auto&#x27;; document.body.style.height = &#x27;auto&#x27;; document.all[0].removeAttribute(&quot;class&quot;) })()</code></pre>
bretthopper将近 5 年前
I was using the &quot;Remote Sticky&quot; bookmarklet in Chrome for 1-2 years now but when I moved to Firefox I switched to an add-on which does it: <a href="https:&#x2F;&#x2F;addons.mozilla.org&#x2F;en-CA&#x2F;firefox&#x2F;addon&#x2F;kill-sticky&#x2F;" rel="nofollow">https:&#x2F;&#x2F;addons.mozilla.org&#x2F;en-CA&#x2F;firefox&#x2F;addon&#x2F;kill-sticky&#x2F;</a><p>The benefit of using the add-on in Firefox is it a keyboard shortcut (that you can customize). So now instead of having to find+click a bookmarklet, I just hit cmd+shift+k on most sites I visit.
评论 #23447890 未加载
评论 #23459556 未加载
mosselman将近 5 年前
Shameless yet relevant plug: <a href="https:&#x2F;&#x2F;bookmarkify.it&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bookmarkify.it&#x2F;</a><p>My free service where you can create bookmarklets. I use them for various things. One thing I am quite happy about lately is generating random things for forms. I use this when I test things in the browser at work, signup flows, etc.<p>Another thing that is useful is turning on dark mode for things: <a href="https:&#x2F;&#x2F;bookmarkify.it&#x2F;33985" rel="nofollow">https:&#x2F;&#x2F;bookmarkify.it&#x2F;33985</a>
grenoire将近 5 年前
One remark regarding the speed bookmarks: it should be .8 instead of .75 as 1 &#x2F; 1.25 is .8, not .75.<p>As is, if you + - + -, you end up at 0.87890625 instead of 1.
评论 #23446654 未加载
zan将近 5 年前
This is great, thank you for sharing.<p>I recently created this one to help with my particular GitHub workflow - instantly diff any commit with the current master branch: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;zmarkan&#x2F;503789d31acf385e44f13b0b3c3c7af4" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;zmarkan&#x2F;503789d31acf385e44f13b0b3c3c...</a>
nickjj将近 5 年前
This one is useful sometimes: javascript:document.body.contentEditable = true; void 0;<p>It lets you directly edit most content on a site. Kind of nice for quickly changing the wording to see if it fits nicely in a layout.<p>You can paste it into the URL bar to test it out. Just manually add &quot;javascript:&quot; since browsers tend to strip that out on paste.
FiddlerClamp将近 5 年前
I&#x27;ve been using Zap and Zap Colors from this site for the past 15+ years: <a href="https:&#x2F;&#x2F;www.squarefree.com&#x2F;bookmarklets&#x2F;zap.html" rel="nofollow">https:&#x2F;&#x2F;www.squarefree.com&#x2F;bookmarklets&#x2F;zap.html</a>
nvr219将近 5 年前
Don&#x27;t forget this one!<p><pre><code> javascript:window.location=%22http:&#x2F;&#x2F;news.ycombinator.com&#x2F;submitlink?u=%22+encodeURIComponent(document.location)+%22&amp;t=%22+encodeURIComponent(document.title)</code></pre>
textread将近 5 年前
Chrome bookmarklets to access archive.today cache<p>Open the oldest archive of the current url:<p>javascript:(function(){ document.location.href = &quot;<a href="http:&#x2F;&#x2F;archive.is&#x2F;oldest&#x2F;&quot;" rel="nofollow">http:&#x2F;&#x2F;archive.is&#x2F;oldest&#x2F;&quot;</a> + document.location.href; })();<p>Open the most recent archive of the current url:<p>javascript:(function(){ document.location.href = &quot;<a href="http:&#x2F;&#x2F;archive.is&#x2F;newest&#x2F;&quot;" rel="nofollow">http:&#x2F;&#x2F;archive.is&#x2F;newest&#x2F;&quot;</a> + document.location.href; })();
raksoras将近 5 年前
A shameless plug: <a href="https:&#x2F;&#x2F;zipl.ink&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zipl.ink&#x2F;</a> To send any open webpage to your mobile without any bluetooth or airdrop
KoenDG将近 5 年前
Highlights all hyperslinks on a page in yellow<p><pre><code> javascript:(function(){for(i=0;i&lt;document.links.length;i++)document.links[i].style.backgroundColor=&#x27;#ffff00&#x27;;})();</code></pre>
sthottingal将近 5 年前
Here is a simple bookmarklet to quickly turn any browser tab to a rich text editor:<p>data:text&#x2F;html, &lt;body contenteditable style=&quot;margin:2rem;&quot;&gt;<p>Open the above as URL in a browser tab and bookmark.
评论 #23447274 未加载
lpellis将近 5 年前
I also wrote about a few I find useful, biggest one is &#x27;Sane Color&#x27;, it changes the text to be black on white. (Some sites have very hard to read colors, and sometimes I prefer light mode over dark) <a href="https:&#x2F;&#x2F;loftie.com&#x2F;post&#x2F;3-useful-bookmarklets-i-use-almost-daily&#x2F;" rel="nofollow">https:&#x2F;&#x2F;loftie.com&#x2F;post&#x2F;3-useful-bookmarklets-i-use-almost-d...</a>
dang将近 5 年前
It&#x27;s a good submission, but lists can&#x27;t be Show HNs. Please read the rules: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;showhn.html" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;showhn.html</a>.<p>(I&#x27;ve popped &quot;Show HN&quot; off the title now.)
评论 #23450491 未加载
chmaynard将近 5 年前
I&#x27;d like to use one or more bookmarklets to (1) define a standard size and location for my Safari windows, and (2) reset the size and location of the current window to the standard settings. Can bookmarklets persist information for later use?
评论 #23451497 未加载
butz将近 5 年前
It&#x27;s great that anyone can just drag drop bookmarklet from website into bookmark bar and just use it without any restrictions, unlike extensions. No signing and uploading to &quot;extension store&quot;.
评论 #23447228 未加载
hawski将近 5 年前
I use remove sticky bookmarklet frequently. On Firefox one can place a bookmark wherever one wants, so I have a Panic! button to unstick&#x2F;unfix those dreadful headers.
评论 #23446805 未加载
josinalvo将近 5 年前
Is there any way around having to click a bookmarklet on the bookmarks toolbar?<p>I do not keep a bookmarks toolbar active, and also prefer to do things on the keyboard whenever possible.
评论 #23453302 未加载
评论 #23453510 未加载
pyuser583将近 5 年前
Bookmarklets always seem like an idea whose time is past, but they never go away.
BiteCode_dev将近 5 年前
I adore bookmarklets, I use:<p><pre><code> javascript:(function(){function%20init(){var%20newline=unescape(%22%%22+%220A%22);dead=false;oldCSS=null;x=opener;ta=document.f.ta;ta.select();ta.value=%22&#x2F;*%20Type%20CSS%20rules%20here%20and%20they%20will%20be%20applied%20to%22+newline+%22whatever%20page%20is%20loaded%20in%20that%20tab,%20as%20long%20as%20the%20pages%22+newline+%22are%20from%20&#x27;%22+location.host+%22&#x27;%22+newline+%22and%20you%20keep%20this%20window%20open.%20*&#x2F;%22+newline+newline;update();}function%20update(){try{if(!x||x.closed){ta.style.backgroundColor=%22#ddd%22;return;}x.bookmarkletStyleSheet;}catch(er){ta.style.backgroundColor=%22#fdc%22;setTimeout(update,150);dead=true;return;}if(dead){dead=false;ta.style.backgroundColor=%22%22;oldCSS=null;}if(!x.testStyles){var%20newSS;newSS=x.document.createElement(%22link%22);newSS.rel=%22stylesheet%22;newSS.type=%22text&#x2F;css%22;x.document.getElementsByTagName(%22head%22)[0].appendChild(newSS);x.testStyles=newSS;oldCSS=null;}if(oldCSS!=ta.value){oldCSS=ta.value;if(window.opera)x.testStyles.href=%22javascript:unescape(&#x27;%22+escape(ta.value)+%22&#x27;)%22;else%20if(navigator.userAgent.indexOf(%22MSIE%22)!=-1)x.testStyles.href=%22javascript:unescape(&#x27;%22+escape(escape(ta.value))+%22&#x27;)%22;else%20x.testStyles.href=%22data:text&#x2F;css,%22+escape(ta.value);}setTimeout(update,150);}y=window.open(&#x27;&#x27;,&#x27;&#x27;,&#x27;resizable,width=500,height=300&#x27;);y.document.write(&#x27;&lt;title&gt;New%20CSS%20Style%20Sheet&lt;&#x2F;title&gt;&lt;style&gt;.ec%20{%20width:%20100%;%20height:%20100%;%20border:%20none;%20margin:%200px;%20padding:%200px;%20}&lt;&#x2F;style&gt;&lt;body%20class=%22ec%22&gt;&lt;form%20name=%22f%22%20style=%22margin:%200px;%22%20class=%22ec%22&gt;&lt;textarea%20name=%22ta%22%20wrap=%22soft%22%20style=%22margin:%200px;%20border:%200px;%20width:100%;%20height:100%;%22%20class=%22ec%22&gt;&lt;&#x2F;textarea&gt;&lt;script&gt;&#x27;+update+init+&#x27;init();&lt;&#x27;+&#x27;&#x2F;script&gt;&#x27;);y.document.close();})() </code></pre> To quickly edit the css style of anything.<p>And:<p><pre><code> javascript:(function()%7Blet%20style%20%3D%20document.getElementById(&#x27;__colorallblocks__&#x27;)%3Bif%20(style)%7Bstyle.remove()%3B%7D%20else%20%7Bstyle%20%3D%20document.createElement(&#x27;style&#x27;)%3Bstyle.id%20%3D%20&#x27;__colorallblocks__&#x27;%3Bstyle.innerHTML%20%3D%20%60*%20%7B%20background-color%3A%20rgba(255%2C0%2C0%2C.2)%3B%20%7D*%20*%20%7B%20background-color%3A%20rgba(0%2C255%2C0%2C.2)%3B%20%7D*%20*%20*%20%7B%20background-color%3A%20rgba(0%2C0%2C255%2C.2)%3B%20%7D*%20*%20*%20*%20%7B%20background-color%3A%20rgba(255%2C0%2C255%2C.2)%3B%20%7D*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(0%2C255%2C255%2C.2)%3B%20%7D*%20*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(255%2C255%2C0%2C.2)%3B%20%7D*%20*%20*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(255%2C0%2C0%2C.2)%3B%20%7D*%20*%20*%20*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(0%2C255%2C0%2C.2)%3B%20%7D*%20*%20*%20*%20*%20*%20*%20*%20*%20%7B%20background-color%3A%20rgba(0%2C0%2C255%2C.2)%3B%20%7D%60%3Bdocument.body.appendChild(style)%3B%7D%7D)() </code></pre> To color all blocks in a page.<p>But if the equivalent exist as a Firefox add on, I use that instead, because it bypasses many restrictions.<p>In this article, the video BM can be replaced with the excellent &quot;Enhancer for Youtube&quot;, at least on Youtube: <a href="https:&#x2F;&#x2F;addons.mozilla.org&#x2F;fr&#x2F;firefox&#x2F;addon&#x2F;enhancer-for-youtube&#x2F;" rel="nofollow">https:&#x2F;&#x2F;addons.mozilla.org&#x2F;fr&#x2F;firefox&#x2F;addon&#x2F;enhancer-for-you...</a>. Just being able to change the speed of the video using the mouse wheel is a god send.<p>Same for archive.li or the way back machine.<p>But I&#x27;ll steal the space scroll one, this red bar is nifty.
fortran77将近 5 年前
And some, I don&#x27;t.
评论 #23449760 未加载
评论 #23448150 未加载
thegeekpirate将近 5 年前
I moved over to Violentmonkey (<a href="https:&#x2F;&#x2F;violentmonkey.github.io" rel="nofollow">https:&#x2F;&#x2F;violentmonkey.github.io</a>) so everything I needed bookmarklets for is now automated, instead of having to hunt around my bookmark folders.<p>You can even add them as right-click menu options for those scripts which you rarely use!