Преглед на файлове

hook history.pushState only on http(s) protocols

Gildas преди 7 години
родител
ревизия
747c052c46
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      extension/core/content/content-autosave.js

+ 1 - 1
extension/core/content/content-autosave.js

@@ -34,7 +34,7 @@ this.singlefile.autosave = this.singlefile.autosave || (async () => {
 			refresh();
 		}
 	});
-	if (document instanceof HTMLDocument) {
+	if (location.href.startsWith("http") && document instanceof HTMLDocument) {
 		const scriptElement = document.createElement("script");
 		scriptElement.textContent = `(${hookPushState.toString()})()`;
 		document.documentElement.appendChild(scriptElement);