您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add a button to enable Hypothesis on any webpage. The button will be removed after being clicked. / 在任意網頁上添加一個按鈕,以啟用 Hypothesis。點擊按鈕後,按鈕將被移除。
当前为
// ==UserScript== // @name Hypothesis Button on Every Page / 每個頁面上的 Hypothesis 按鈕 // @namespace iamfredchu // @version 0.0.2 // @description Add a button to enable Hypothesis on any webpage. The button will be removed after being clicked. / 在任意網頁上添加一個按鈕,以啟用 Hypothesis。點擊按鈕後,按鈕將被移除。 // @author Fred Chu // @match https://*/* // @inject-into content // @run-at document-end // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html // ==/UserScript== (function() { function enableHypothesis() { const d = document; const s = document.createElement('script'); s.setAttribute('src', 'https://hypothes.is/embed.js'); d.body.appendChild(s); // Remove the button after it's clicked hypothesisButton.remove(); } function createHypothesisButton() { const btn = document.createElement('button'); btn.textContent = 'Enable Hypothesis'; btn.style.position = 'fixed'; btn.style.bottom = '10px'; btn.style.right = '10px'; btn.style.zIndex = '9999'; btn.addEventListener('click', enableHypothesis); document.body.appendChild(btn); return btn; } const hypothesisButton = createHypothesisButton(); })();