Skip to content

Instantly share code, notes, and snippets.

@bigwheel
Last active December 1, 2023 08:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigwheel/18609f2dae61c7f63ed8 to your computer and use it in GitHub Desktop.
Save bigwheel/18609f2dae61c7f63ed8 to your computer and use it in GitHub Desktop.
ajaxページ用tampermonkeyテンプレート
// ==UserScript==
// @name 適当な名前
// @namespace https://github.com/bigwheel とか
// @version 1.0
// @description this is description
// @author 著者
// @match https://github.com/* 適応したいURLをワイルドカードで
// @grant GM_xmlhttpRequest SCPやらajaxのクロスドメイン問題を避けるためにこれを使おう
// ==/UserScript==
if(document.body && $('ここで指定した要素があると変更を適応')) {
MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
var observer = new MutationObserver(function(mutations, observer) {
// 変更したい内容
});
observer.observe(document, {
subtree: true,
attributes: true
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment