瀏覽代碼

Consider Safari as non-compliant

Gildas 5 年之前
父節點
當前提交
bc43a5ceba
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js

+ 2 - 1
extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js

@@ -24,8 +24,9 @@
 (() => {
 (() => {
 
 
 	const FEATURE_TESTS = {};
 	const FEATURE_TESTS = {};
+	const NON_COMPLIANT_IMPLEMENTATION = this.origin.startsWith("safari-web-extension://");
 
 
-	if (!this.browser && this.chrome) {
+	if ((!this.browser || NON_COMPLIANT_IMPLEMENTATION) && this.chrome) {
 		const nativeAPI = this.chrome;
 		const nativeAPI = this.chrome;
 		this.__defineGetter__("browser", () => ({
 		this.__defineGetter__("browser", () => ({
 			browserAction: {
 			browserAction: {