Skip to content

Instantly share code, notes, and snippets.

@oychao
Last active December 11, 2018 04:35
Show Gist options
  • Save oychao/38867be3617244a39ae55a8a81026ec8 to your computer and use it in GitHub Desktop.
Save oychao/38867be3617244a39ae55a8a81026ec8 to your computer and use it in GitHub Desktop.
tamper monkey scripts
// ==UserScript==
// @name 起点PC阅读优化脚本
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://read.qidian.com/chapter/*
// @grant none
// @require http://code.jquery.com/jquery-1.12.4.min.js
// ==/UserScript==
$(function() {
'use strict';
const ad = document.querySelector('#j_bodyRecWrap')
ad.parentNode.removeChild(ad);
const themeTarget = document.querySelector('.theme-0');
let theme = 1;
Object.defineProperty(window, 'theme', {
get() {
return theme;
},
set(val) {
theme = val;
themeTarget.className = `theme-${theme}`;
localStorage.theme = val;
}
});
window.theme = localStorage.theme || 6;
// Your code here...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment