diff --git a/platform/opera/manifest.json b/platform/opera/manifest.json index 9aa58f523..07e956c80 100644 --- a/platform/opera/manifest.json +++ b/platform/opera/manifest.json @@ -82,5 +82,8 @@ "default_panel": "logger-ui.html", "default_title": "__MSG_statsPageName__" }, - "version": "1.14.23.17" + "version": "1.14.23.17", + "web_accessible_resources": [ + "/web_accessible_resources/*" + ] } diff --git a/tools/make-opera-meta.py b/tools/make-opera-meta.py index 15df315fb..4fb2cb960 100644 --- a/tools/make-opera-meta.py +++ b/tools/make-opera-meta.py @@ -10,20 +10,17 @@ if len(sys.argv) == 1 or not sys.argv[1]: proj_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], '..') build_dir = os.path.abspath(sys.argv[1]) -# Import version number from chromium platform -chromium_manifest = {} -webext_manifest = {} +version = '' +with open(os.path.join(proj_dir, 'dist', 'version')) as f: + version = f.read().strip() -chromium_manifest_file = os.path.join(proj_dir, 'platform', 'chromium', 'manifest.json') -with open(chromium_manifest_file) as f1: - chromium_manifest = json.load(f1) +manifest_out = {} +manifest_out_file = os.path.join(build_dir, 'manifest.json') +with open(manifest_out_file) as f: + manifest_out = json.load(f) -webext_manifest_file = os.path.join(build_dir, 'manifest.json') -with open(webext_manifest_file) as f2: - webext_manifest = json.load(f2) +manifest_out['version'] = version -webext_manifest['version'] = chromium_manifest['version'] - -with open(webext_manifest_file, 'w') as f2: - json.dump(webext_manifest, f2, indent=2, separators=(',', ': '), sort_keys=True) +with open(manifest_out_file, 'w') as f2: + json.dump(manifest_out, f2, indent=2, separators=(',', ': '), sort_keys=True) f2.write('\n') diff --git a/tools/make-opera.sh b/tools/make-opera.sh index 7e00d3287..a04bd0a98 100755 --- a/tools/make-opera.sh +++ b/tools/make-opera.sh @@ -39,6 +39,10 @@ rm -r $DES/_locales/kk rm -r $DES/_locales/mr rm -r $DES/_locales/ta +echo "*** uBlock0.opera: Generating web accessible resources..." +cp -R src/web_accessible_resources $DES/ +python3 tools/import-war.py $DES/ + echo "*** uBlock0.opera: Generating meta..." python tools/make-opera-meta.py $DES/