您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add a link in the top banner of [Hacker News discussion](http://news.ycombinator.com/) to its counter part at [HN Premii](http://hn.premii.com/)
当前为
// ==UserScript== // @name Hacker News // @namespace com.ycombinator.news // @include https://news.ycombinator.com/* // @version 1.0 // @grant none // @description Add a link in the top banner of [Hacker News discussion](http://news.ycombinator.com/) to its counter part at [HN Premii](http://hn.premii.com/) // ==/UserScript== function readerUrl(id) { var url = 'http://hn.premii.com/'; if (id > 0) { url += '#/comments/' + id; } return url; } var id = location.search.split('id=') [1] ? location.search.split('id=') [1] : - 1; var readerLink = ' | <a href="' + readerUrl(id) + '">Reader</a>' var topMenu = document.getElementsByClassName('pagetop') [0]; topMenu.innerHTML += readerLink;