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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Share Your Favorite Bookmarklets

28 点作者 takinola大约 2 个月前
Here are a couple bookmarklets I find myself using often:<p>Post current web page to HN<p><pre><code> javascript:window.location=&quot;http:&#x2F;&#x2F;news.ycombinator.com&#x2F;submitlink?u=&quot;+encodeURIComponent(document.location)+&quot;&amp;t=&quot;+encodeURIComponent(document.title) </code></pre> Find Archive.is link<p><pre><code> javascript:window.location=&quot;http:&#x2F;&#x2F;archive.is&#x2F;newest&#x2F;&quot;+document.location</code></pre>

8 条评论

ashtonmeuser大约 1 个月前
For anyone stumbling upon this that deals with bookmarklets, I submit bookmarkl.ink[0], a tool I made to ease the maintenance of bookmarklets.<p>In short, it pulls code from GitHub Gists (which have the benefit of being backed by git repos), transpiles, minifies, bundles, and wraps in an IIFE. It&#x27;s also got a basic module resolver that allows you to include libraries or remote files.<p>This allows you to use creature comforts like TS and libraries and maintain code readability while still ending up with the smallest possible bookmarklet. It also allows you to link to a particular version (git hash), present user-defined variables, edit code in an inline editor, etc.<p>Enjoy!<p>[0]: <a href="https:&#x2F;&#x2F;bookmarkl.ink" rel="nofollow">https:&#x2F;&#x2F;bookmarkl.ink</a>
SonuSitebot大约 1 个月前
1. At sitebot, we focus on AI-driven solutions for businesses, but these bookmarklets remind me how simple automation can make life easier. Has anyone experimented with AI-powered bookmarklets, like quick content summarization or auto-filling forms based on context?<p>2. As someone who works across frontend and backend development, I still find bookmarklets incredibly useful for quick debugging and automation. While browser restrictions have tightened, tools like Tampermonkey or custom browser extensions can still help power users retain control. What are some creative ways you&#x27;ve found to keep bookmarklets alive?
tompark大约 2 个月前
Oh it&#x27;s nice to see productivity ones. I mostly use bookmarklets on my phone to fix annoyances bc on a desktop browser you can just open the js console or inspector.<p>I beefed up the &#x27;kill sticky&#x27; one &lt;<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32998091">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32998091</a>&gt; but that&#x27;s not very interesting. Here are some other ones:<p>* Re-enable zoom on iPhone (for pages that disable it)<p><pre><code> javascript:document.querySelector(&#x27;meta%5Bname=viewport%5D&#x27;).setAttribute(&#x27;content&#x27;,&#x27;width=device-width,initial-scale=1.0,maximum-scale=10.0,user-scalable=1&#x27;); </code></pre> * Open same page in new tab with js script tags removed (you must click to allow it to open a new tab)<p><pre><code> javascript:(window.openPageWithoutScripts=async%20function()%7Bconst%20resp=await%20fetch(window.location.href);const%20text=await%20resp.text();const%20doc=new%20DOMParser().parseFromString(text,&#x27;text%2Fhtml&#x27;);doc.querySelectorAll(&#x27;script&#x27;).forEach(script=%3Escript.remove());const%20w=window.open();w.document.head.innerHTML=doc.head.innerHTML;w.document.body.innerHTML=doc.body.innerHTML;%7D)(); </code></pre> * Show page source<p><pre><code> javascript:(function()%7Bvar%20a=window.open(&#x27;about:blank&#x27;).document;a.write(&#x27;%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3Ctitle%3ESource%20of%20&#x27;+location.href+&#x27;%3C&#x2F;title%3E%3Cmeta%20name=%22viewport%22%20content=%22width=device-width%22%20&#x2F;%3E%3C&#x2F;head%3E%3Cbody%3E%3C&#x2F;body%3E%3C&#x2F;html%3E&#x27;);a.close();var%20b=a.body.appendChild(a.createElement(&#x27;pre&#x27;));b.style.overflow=&#x27;auto&#x27;;b.style.whiteSpace=&#x27;pre-wrap&#x27;;b.appendChild(a.createTextNode(document.documentElement.innerHTML))%7D)(); </code></pre> * Re-enable long-press context menu (for pages that disable it)<p><pre><code> javascript:(function()%7Bdocument.oncontextmenu=null;window.oncontextmenu=null;%7D)(); </code></pre> * Re-enable text selection (for pages that disable it)<p><pre><code> javascript:(function()%7B;document.onselectstart=null;document.onselectchange=null;document.ondragstart=null;document.onmousedown=null;window.ontouchstart=null;window.ontouchend=null;%7D)();</code></pre>
spidersenses大约 2 个月前
As a Reddit user I&#x27;m using this simple replace function to switch to the old.reddit.com version of a page:<p>javascript:(function(){ if (location.hostname === &quot;www.reddit.com&quot;) { location.href = location.href.replace(&quot;www.reddit.com&quot;, &quot;old.reddit.com&quot;); }})();<p>Necessary due to Google search results on Reddit leading to the new.reddit.com version of a page which demands a login more often than not.
hboon大约 2 个月前
Scroll to bottom:<p><pre><code> javascript:(function(){window.scrollTo({top:document.body.scrollHeight,behavior:&#x27;smooth&#x27;});})(); </code></pre> Scroll to bottom x 10:<p><pre><code> javascript:(function(){%20let%20count%20=%200;%20const%20interval%20=%20setInterval(()%20=&gt;%20{%20window.scrollTo({%20top:%20document.body.scrollHeight,%20behavior:%20&#x27;smooth&#x27;%20});%20count++;%20if%20(count%20&gt;=%2010)%20clearInterval(interval);%20},%201000);%20})(); </code></pre> Skip YouTube video ad:<p><pre><code> javascript:(function()%7Bvar%20skipButton=document.querySelector(&#x27;button.ytp-ad-skip-button-modern&#x27;);if(skipButton)%7BskipButton.click();%7Delse%7Bdocument.querySelector(&#x27;video&#x27;).currentTime=document.querySelector(&#x27;video&#x27;).duration;%7D%7D)();</code></pre>
perilunar大约 2 个月前
I hate sticky and fixed page headers, so these two are handy:<p>Convert fixed position to absolute:<p><pre><code> javascript:(function(){var%20i,%20elements=document.querySelectorAll(&#x27;body%20*&#x27;);for%20(i=0;%20i&lt;elements.length;%20i++)%20{if%20(getComputedStyle(elements[i]).position%20===&#x27;fixed&#x27;){elements[i].style.position=&#x27;absolute&#x27;;}}})(); </code></pre> Convert sticky position to absolute:<p><pre><code> javascript:(function(){var%20i,%20elements=document.querySelectorAll(&#x27;body%20*&#x27;);for%20(i=0;%20i&lt;elements.length;%20i++)%20{if%20(getComputedStyle(elements[i]).position%20===&#x27;sticky&#x27;){elements[i].style.position=&#x27;absolute&#x27;;}}})(); </code></pre> Though looking at them now I should combine and update them.
fouc大约 2 个月前
Bookmarklets are effectively dead, unless they&#x27;re extremely simple or you use Firefox. It&#x27;s kinda ridiculous that they&#x27;ve been effectively blocked by changes to browsers (like chromium-based ones) that make it nearly impossible to run JavaScript from the address bar, along with &quot;Content Security Policy&quot; rules that enable widespread blocking of inline scripts.<p>It&#x27;s unfortunate that browser developers want to fully derisk all potential security holes, because that also means removing the choice from the end user. This ends up being security by infantilization.
评论 #43492600 未加载
评论 #43528198 未加载
jackiefeng大约 2 个月前
give a try TabTab <a href="https:&#x2F;&#x2F;tabatb.xyz" rel="nofollow">https:&#x2F;&#x2F;tabatb.xyz</a>
评论 #43489758 未加载