Refactoring to use DocRewriter.
This commit is contained in:
parent
68fbf0dded
commit
2d9835591d
|
@ -18,6 +18,8 @@
|
|||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// depends on /nscl/content/DocRewriter.js
|
||||
|
||||
"use strict";
|
||||
|
||||
(window.ns || (window.ns = {})).syncFetchPolicy = function() {
|
||||
|
@ -116,7 +118,6 @@
|
|||
try {
|
||||
debug("Soft reload", ev); // DEV_ONLY
|
||||
try {
|
||||
let doc = window.wrappedJSObject.document;
|
||||
let isDir = document.querySelector("link[rel=stylesheet][href^='chrome:']")
|
||||
&& document.querySelector(`base[href^="${url}"]`);
|
||||
if (isDir || document.contentType !== "text/html") {
|
||||
|
@ -127,10 +128,7 @@
|
|||
|
||||
let html = document.documentElement.outerHTML;
|
||||
let sx = window.scrollX, sy = window.scrollY;
|
||||
doc.open();
|
||||
console.debug("Opened", doc.documentElement);
|
||||
doc.write(html);
|
||||
doc.close();
|
||||
DocRewriter.rewrite(html);
|
||||
debug("Written", html);
|
||||
// Work-around this rendering bug: https://forums.informaction.com/viewtopic.php?p=103105#p103050
|
||||
debug("Scrolling back to", sx, sy);
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
"/nscl/common/CSP.js",
|
||||
"/nscl/common/CapsCSP.js",
|
||||
"/nscl/common/RequestKey.js",
|
||||
"/nscl/content/DocRewriter.js",
|
||||
"/nscl/content/patchWindow.js",
|
||||
"/nscl/content/patchWorkers.js",
|
||||
"/nscl/content/DocumentCSP.js",
|
||||
|
|
2
src/nscl
2
src/nscl
|
@ -1 +1 @@
|
|||
Subproject commit 9705b11ac271b44c70fc086a162326a83c0b2dbe
|
||||
Subproject commit 3aff8f5c9820437c52dedaeaa0b73631eecbfeee
|
Loading…
Reference in New Issue