Skip to content

Instantly share code, notes, and snippets.

@tomotomo9696
Last active June 16, 2017 04:39
Show Gist options
  • Save tomotomo9696/0adb1ea9bf007439ad2df6856ba3b0ff to your computer and use it in GitHub Desktop.
Save tomotomo9696/0adb1ea9bf007439ad2df6856ba3b0ff to your computer and use it in GitHub Desktop.
適当。Tampermonkey とかで、ユーザースクリプトとして。 そのうち使えなくなるかも?
{"created_by":"Tampermonkey","version":"1","scripts":[{"name":"twitter","options":{"check_for_updates":true,"comment":null,"compatopts_for_requires":true,"compat_wrappedjsobject":false,"compat_metadata":false,"compat_foreach":false,"compat_arrayleft":false,"compat_uW_gmonkey":false,"compat_forvarin":false,"noframes":false,"awareOfChrome":false,"run_at":"document-body","override":{"use_includes":["https://twitter.com/*"],"orig_includes":["https://twitter.com/*"],"merge_includes":true,"use_matches":[],"orig_matches":[],"merge_matches":true,"use_excludes":[],"orig_excludes":[],"merge_excludes":true,"use_connects":[],"merge_connects":true,"use_blockers":[],"orig_run_at":"document-idle","orig_noframes":null,"orig_connects":[]}},"enabled":true,"position":1,"uuid":"e57a14a9-3781-4313-8a71-51c5e3de222e","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICB0d2l0dGVyCi8vIEB2ZXJzaW9uICAgICAgMQovLyBAZGVzY3JpcHRpb24gIHR3aXR0ZXLjga7jgq/jgr3jg4fjgrbjgqTjg7PjgpLmiLvjgZnjgIIKLy8gQGF1dGhvciAgICAgICB0b21vdG9tbzk2OTYKLy8gQGluY2x1ZGUgICAgICBodHRwczovL3R3aXR0ZXIuY29tLyoKLy8gQHJlcXVpcmUgICAgICBodHRwczovL2FqYXguZ29vZ2xlYXBpcy5jb20vYWpheC9saWJzL2pxdWVyeS8zLjIuMS9qcXVlcnkubWluLmpzCi8vID09L1VzZXJTY3JpcHQ9PQooZnVuY3Rpb24oKSB7CiAgdmFyIGVsZW0gPSAkKCJib2R5Iik7CiAgZWxlbS5yZW1vdmVDbGFzcygiZWRnZS1kZXNpZ24iKTsKICB2YXIgb2JzZXJ2ZXIgPSBuZXcgTXV0YXRpb25PYnNlcnZlcihmdW5jdGlvbihtdXRhdGlvbnMpIHsKICAgIG11dGF0aW9ucy5mb3JFYWNoKGZ1bmN0aW9uKG11dGF0aW9uKSB7CiAgICAgIGlmKG11dGF0aW9uLmF0dHJpYnV0ZU5hbWUgPT09ICJjbGFzcyIgJiYgJChtdXRhdGlvbi50YXJnZXQpLnByb3AobXV0YXRpb24uYXR0cmlidXRlTmFtZSkubWF0Y2goL2VkZ2UtZGVzaWduLykpewogICAgICAgIGVsZW0ucmVtb3ZlQ2xhc3MoImVkZ2UtZGVzaWduIik7CiAgICAgIH0KICAgIH0pOwogIH0pOwogIG9ic2VydmVyLm9ic2VydmUoZWxlbVswXSwge2F0dHJpYnV0ZXM6IHRydWV9KTsKfSkoKTs="}]}
// ==UserScript==
// @name twitter
// @version 1
// @description twitterのクソデザインを戻す。
// @author tomotomo9696
// @include https://twitter.com/*
// @run-at document-body
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// ==/UserScript==
(function() {
'use strict';
var elem = $("body");
elem.removeClass("edge-design");
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if(mutation.attributeName === "class" && $(mutation.target).prop(mutation.attributeName).match(/edge-design/)){
elem.removeClass("edge-design");
}
});
});
observer.observe(elem[0], {attributes: true});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment