瀏覽代碼

display infobar only for file:/// URIs

Gildas 7 年之前
父節點
當前提交
f16a68a64d
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      extension/ui/content/infobar.js

+ 2 - 2
extension/ui/content/infobar.js

@@ -18,7 +18,7 @@
  *   along with SingleFile.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* global browser, document, Node, window, top, getComputedStyle */
+/* global browser, document, Node, window, top, getComputedStyle, location */
 
 this.singlefile.infobar = this.singlefile.infobar || (() => {
 
@@ -27,7 +27,7 @@ this.singlefile.infobar = this.singlefile.infobar || (() => {
 	const IMAGE_ICON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABIUlEQVQ4y+2TsarCMBSGvxTBRdqiUZAWOrhJB9EXcPKFfCvfQYfulUKHDqXg4CYUJSioYO4mSDX3ttzt3n87fMlHTpIjlsulxpDZbEYYhgghSNOUOI5Ny2mZYBAELBYLer0eAJ7ncTweKYri4x7LJJRS0u12n7XrukgpjSc0CpVSXK/XZ32/31FKNW85z3PW6zXT6RSAJEnIsqy5UGvNZrNhu90CcDqd+C6tT6J+v//2Th+PB2VZ1hN2Oh3G4zGTyQTbtl/YbrdjtVpxu91+Ljyfz0RRhG3bzOfzF+Y4TvNXvlwuaK2pE4tfzr/wzwsty0IIURlL0998KxRCMBqN8H2/wlzXJQxD2u12vVkeDoeUZUkURRU+GAw4HA7s9/sK+wK6CWHasQ/S/wAAAABJRU5ErkJggg==";
 	const SINGLEFILE_COMMENT = "Archive processed by SingleFile";
 
-	if (window == top) {
+	if (window == top && location && location.href && location.href.startsWith("file:///")) {
 		if (document.readyState == "loading") {
 			document.addEventListener("DOMContentLoaded", displayIcon, false);
 		} else {