Skip to content

Instantly share code, notes, and snippets.

@chromia
Last active August 14, 2020 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chromia/4bfa2f154f8aaf4937478b6f86efc384 to your computer and use it in GitHub Desktop.
Save chromia/4bfa2f154f8aaf4937478b6f86efc384 to your computer and use it in GitHub Desktop.
Django公式サイトのDOCUMENTATIONリンクをクリックしたときに、英語ではなく日本語文書に飛ぶようにするTamperMonkeyスクリプト
// ==UserScript==
// @name Always use Japanese for Django Docs
// @namespace chromia
// @version 0.1
// @description replace link URL to Django Documentation(+ ja/)
// @author chromia<chromia@outlook.jp>
// @match https://www.djangoproject.com/*
// @match https://docs.djangoproject.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var elements = document.querySelectorAll(".container > div[role='navigation'] > ul > li:nth-child(3) > a");
if(elements.length > 0){
var link = elements[0];
link.href += "ja/";
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment