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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: POST links: hiding pages from crawlers without JavaScript

2 点作者 panic大约 1 个月前

1 comment

mubou大约 1 个月前
Interesting use of formaction on a button. One suggestion: put role=&quot;link&quot; on it so it appears as a link to screen readers as well.<p>Unfortunately, by using a button you can&#x27;t right click to copy the URL or open in a new tab&#x2F;window. Middle clicking doesn&#x27;t work either, although that could be fixed with JS. The URL also doesn&#x27;t show up in the bottom left when hovering.<p>Edit: One thing you could do if you don&#x27;t mind making your site JS-only is intercept link clicks and trigger a form POST instead, so the links are all normal links that respect default browser behavior, but the requests are all made as POSTs. Though honestly it&#x27;s a losing battle, trying to stop bots; I&#x27;ve largely given up. You also have to consider what happens when someone shares the URL or bookmarks it, or tried to reload the page.
评论 #43578975 未加载