Left: | ||
Right: |
OLD | NEW |
---|---|
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus build tools, | 3 # This file is part of the Adblock Plus build tools, |
4 # Copyright (C) 2006-2014 Eyeo GmbH | 4 # Copyright (C) 2006-2014 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 if metadata.has_section('contentScripts'): | 107 if metadata.has_section('contentScripts'): |
108 contentScripts = [] | 108 contentScripts = [] |
109 for run_at, scripts in metadata.items('contentScripts'): | 109 for run_at, scripts in metadata.items('contentScripts'): |
110 if scripts == '': | 110 if scripts == '': |
111 continue | 111 continue |
112 contentScripts.append({ | 112 contentScripts.append({ |
113 'matches': ['http://*/*', 'https://*/*'], | 113 'matches': ['http://*/*', 'https://*/*'], |
114 'js': re.split(r'\s+', scripts), | 114 'js': re.split(r'\s+', scripts), |
115 'run_at': run_at, | 115 'run_at': run_at, |
116 'all_frames': True, | 116 'all_frames': True, |
117 'match_about_blank': True, | |
Wladimir Palant
2014/06/02 10:57:11
Is that change backwards-compatible? Meaning: will
Sebastian Noack
2014/06/02 11:48:27
Yes. Tested with Chrome 34.
| |
117 }) | 118 }) |
118 templateData['contentScripts'] = contentScripts | 119 templateData['contentScripts'] = contentScripts |
119 | 120 |
120 manifest = template.render(templateData) | 121 manifest = template.render(templateData) |
121 | 122 |
122 # Normalize JSON structure | 123 # Normalize JSON structure |
123 licenseComment = re.compile(r'/\*.*?\*/', re.S) | 124 licenseComment = re.compile(r'/\*.*?\*/', re.S) |
124 data = json.loads(re.sub(licenseComment, '', manifest, 1)) | 125 data = json.loads(re.sub(licenseComment, '', manifest, 1)) |
125 if '_dummy' in data: | 126 if '_dummy' in data: |
126 del data['_dummy'] | 127 del data['_dummy'] |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
389 writePackage(outFile, pubkey, signature, zipdata) | 390 writePackage(outFile, pubkey, signature, zipdata) |
390 | 391 |
391 def createDevEnv(baseDir, type): | 392 def createDevEnv(baseDir, type): |
392 fileBuffer = StringIO() | 393 fileBuffer = StringIO() |
393 createBuild(baseDir, type=type, outFile=fileBuffer, devenv=True, releaseBuild= True) | 394 createBuild(baseDir, type=type, outFile=fileBuffer, devenv=True, releaseBuild= True) |
394 | 395 |
395 from zipfile import ZipFile | 396 from zipfile import ZipFile |
396 zip = ZipFile(StringIO(fileBuffer.getvalue()), 'r') | 397 zip = ZipFile(StringIO(fileBuffer.getvalue()), 'r') |
397 zip.extractall(os.path.join(baseDir, 'devenv')) | 398 zip.extractall(os.path.join(baseDir, 'devenv')) |
398 zip.close() | 399 zip.close() |
OLD | NEW |