navigate-canonical

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 <[email protected]> (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');

}());