您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Go to the canonical page
- // ==UserScript==
- // @name navigate-canonical
- // @namespace https://ciffelia.com/
- // @version 1.0.0
- // @description Go to the canonical page
- // @author Ciffelia <mc.prince.0203@gmail.com> (https://ciffelia.com/)
- // @license MIT
- // @homepage https://github.com/ciffelia/navigate-canonical#readme
- // @supportURL https://github.com/ciffelia/navigate-canonical/issues
- // @include *
- // @grant GM_registerMenuCommand
- // @run-at document-idle
- // ==/UserScript==
- (function () {
- 'use strict';
- const navigate = () => {
- location.href = document.querySelector('link[rel=canonical]').href;
- };
- GM_registerMenuCommand('Go to the canonical page', navigate, 'g');
- }());