Version 1.8.5

#264
#262
#267
This commit is contained in:
Kevin Röbert
2019-09-29 17:10:26 +02:00
parent 1367284767
commit 191fcfce23
4 changed files with 27 additions and 24 deletions

View File

@@ -24,38 +24,26 @@
(function (window) {
"use strict";
function injectFunction(func) {
function injectFunction() {
var ele = document.createElement('script');
var s = document.getElementsByTagName('script')[0];
ele.type = 'text/javascript';
ele.textContent = '(' + func + ')();';
ele.textContent = "Object.defineProperty(window, 'rwt', {" +
" value: function() { return false; }," +
" writable: false," +
" configurable: false" +
"});";
s.parentNode.insertBefore(ele, s);
}
/*
* Disable the url rewrite function
*/
function disableURLRewrite() {
function inject_init() {
/* Define the url rewrite function */
Object.defineProperty(window, 'rwt', {
value: function() { return true; },
writable: false, // set the property to read-only
configurable: false
});
}
injectFunction(inject_init);
}
/*
* The main entry
*/
function main()
{
disableURLRewrite();
injectFunction();
document.addEventListener('mouseover', function (event) {
var a = event.target, depth = 1;
@@ -65,9 +53,12 @@
}
if (a && a.tagName == 'A') {
a.removeAttribute('onmousedown');
var clone = a.cloneNode(true);
a.parentNode.replaceChild(clone, a);
try {
a.removeAttribute('data-cthref');
delete a.dataset.cthref;
} catch(e) {
console.log(e);
}
}
}, true);
}