소스 검색

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