Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Copy this Novel
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
- // @match https://fictionlog.co/*
- // @match https://www.kawebook.com/story/detail/*
- // @match http://www.tunwalai.com/chapter/*
- // @match https://novel.th-sharing.com/read/*
- // @match https://imakeuread.blogspot.com/*/*/*
- // @match https://www.hongsamut.com/fiction/*
- // @match https://www.thai-novel.com/*
- // @match https://www.tard-niyai.com/*
- // @grant GM_setClipboard
- // @grant GM_notification
- // @grant GM_addStyle
- // ==/UserScript==
- (function() {
- 'use strict';
- var handlerNameArr = ['contextmenu', 'copy', 'cut', 'paste', 'mousedown', 'mouseup', 'beforeunload', 'beforeprint', 'keyup', 'keydown', 'select', 'selectstart'];
- var removeProtection = function removeProtectionName(protectedWindow) {
- for(var i = 0; i < handlerNameArr.length; i++) {
- var handlerName = handlerNameArr[i];
- var handlerOnName = 'on' + handlerName;
- if(protectedWindow[handlerOnName])
- protectedWindow[handlerOnName] = null;
- protectedWindow.addEventListener(handlerName, function(e){ e.stopPropagation(); }, true);
- }
- };
- var removeCssProtection = function removeCssProtectionName() {
- var css = ['* {',
- ' -webkit-user-select:text!important;',
- ' -moz-user-select:text!important;',
- ' -ms-user-select:text!important;',
- ' -o-user-select:text!important;',
- ' user-select:text!important;',
- '}',
- ].join('\n');
- GM_addStyle(css);
- };
- removeProtection(window);
- var frameList = window.frames;
- for(var j = 0; j < frameList.length; j++) {
- try {
- removeProtection(frameList[j]);
- } catch(e) {}
- }
- removeCssProtection();
- if(window.location.href.startsWith('https://fictionlog.co/')) {
- var u = "\u0e01\u0e02\u0e03\u0e04\u0e05\u0e06\u0e07\u0e08\u0e09\u0e0a\u0e0b\u0e0c\u0e0d\u0e0e\u0e0f\u0e10\u0e11\u0e12\u0e13\u0e14\u0e15\u0e16\u0e17\u0e18\u0e19\u0e1a\u0e1b\u0e1c\u0e1d\u0e1e\u0e1f\u0e20\u0e21\u0e22\u0e23\u0e24\u0e25\u0e26\u0e27\u0e28\u0e29\u0e2a\u0e2b\u0e2c\u0e2d\u0e2e\u0e2f\u0e30\u0e31\u0e32\u0e33\u0e34\u0e35\u0e36\u0e37\u0e38\u0e39\u0e3a\u0e40\u0e41\u0e42\u0e43\u0e44\u0e45\u0e46\u0e47\u0e48\u0e49\u0e4a\u0e4b\u0e4c".split("");
- setInterval(function () {
- if($('.enigma').length && window.location.pathname.startsWith('/c/')) {
- var noFonts = parseInt($('body style')[0].innerHTML.substr($('body style')[0].innerHTML.indexOf("/fonts/") + 7, 1)),
- rpETcontent = $('.enigma')[0].innerHTML;
- for(var k = 0; k < 71; k++) {
- var ET2rp = 'e';
- ET2rp += 900 + (k < 2 ? k : (k + 1 + noFonts));
- ET2rp = parseInt(ET2rp, 16);
- rpETcontent = rpETcontent.replace(new RegExp(String.fromCharCode(ET2rp), "g"), u[k]);
- }
- $('.enigma')[0].innerHTML = rpETcontent;
- window.history.replaceState({page: "/" + window.location.pathname}, document.title, "https://fictionlog.co" + window.location.pathname.replace('/c/', '/w/c/'));
- $('.content-detail')[1].addEventListener('dblclick', function (e) {
- var selection = window.getSelection();
- var range = document.createRange();
- range.selectNodeContents($('.content-detail')[1]);
- selection.removeAllRanges();
- selection.addRange(range);
- GM_setClipboard();
- GM_notification ({
- title: 'Notification',
- text: 'ก๊อปปี้เนื้อหาไปยังคลิปบอร์ดแล้ว.',
- timeout: 3000,
- onclick: function () {
- window.focus ();
- },
- });
- });
- }
- }, 1000);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement