瀏覽代碼

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);