-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
266 changed files
with
5,958 additions
and
7,005 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
(() => { | ||
let oldPushState = history.pushState; | ||
history.pushState = function pushState() { | ||
let ret = oldPushState.apply(this, arguments); | ||
window.dispatchEvent(new Event('pushstate')); | ||
window.dispatchEvent(new Event('locationchange')); | ||
return ret; | ||
}; | ||
|
||
let oldReplaceState = history.replaceState; | ||
history.replaceState = function replaceState() { | ||
let ret = oldReplaceState.apply(this, arguments); | ||
window.dispatchEvent(new Event('replacestate')); | ||
window.dispatchEvent(new Event('locationchange')); | ||
return ret; | ||
}; | ||
|
||
window.addEventListener('popstate', () => { | ||
window.dispatchEvent(new Event('locationchange')); | ||
}); | ||
})(); | ||
|
||
window.addEventListener("locationchange", function () { | ||
aaa(); | ||
}); | ||
|
||
document.addEventListener("DOMContentLoaded", (event) => { | ||
aaa(); | ||
}); | ||
|
||
function cleanHead() { | ||
clean("#reader-nav"); | ||
clean(".subnav"); | ||
} | ||
|
||
function clean(selector) { | ||
var elt = document.querySelector(selector); | ||
if (elt != null) elt.remove(); | ||
} | ||
|
||
function eval() { | ||
return new Promise((resolve) => { | ||
setTimeout(() => { | ||
var found = false; | ||
var container = document.querySelector("#pic_container"); | ||
if (container != null) { | ||
container.childNodes.forEach((element) => { | ||
var displayed = true; | ||
var style = element.style; | ||
if (style != null) { | ||
var display = style.display; | ||
if (display != null && display == "none") displayed = false; | ||
} | ||
if (!found && displayed) { | ||
if ("IMG" == element.nodeName) { | ||
console.info("resolve OK IMG"); | ||
found = true; | ||
$interface.$fun(document.URL, document.querySelector("html").innerHTML); | ||
} else { | ||
var canvas = element.querySelector("canvas"); | ||
if (canvas != null) { | ||
console.info("resolve OK CANVAS"); | ||
found = true; | ||
|
||
if ($force_page) { | ||
console.info("force page"); | ||
$interface.$fun(document.URL, document.querySelector("html").innerHTML); | ||
} else { | ||
cleanHead(); | ||
/* Delay for redrawing page */ | ||
setTimeout(() => { | ||
screencap.onLoaded(canvas.width, canvas.height); | ||
}, 500); | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
if (!found) console.info("resolve KO"); | ||
resolve(found); | ||
} | ||
}, 750); | ||
}); | ||
} | ||
|
||
async function aaa() { | ||
console.info("ready"); | ||
var result = await eval(); | ||
if (!result) result = await eval(); | ||
if (!result) result = await eval(); | ||
if (!result) result = await eval(); | ||
if (!result) result = await eval(); | ||
if (!result) result = await eval(); | ||
if (!result) result = await eval(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.