diff -Nru adblock-plus-2.4+dfsg/addChecksum.py adblock-plus-2.6+dfsg/addChecksum.py --- adblock-plus-2.4+dfsg/addChecksum.py 2013-10-10 19:04:38.000000000 +0000 +++ adblock-plus-2.6+dfsg/addChecksum.py 2014-04-22 06:28:36.000000000 +0000 @@ -2,7 +2,7 @@ # coding: utf-8 # This file is part of Adblock Plus , -# Copyright (C) 2006-2013 Eyeo GmbH +# Copyright (C) 2006-2014 Eyeo GmbH # # Adblock Plus is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as diff -Nru adblock-plus-2.4+dfsg/buildtools/background.html.tmpl adblock-plus-2.6+dfsg/buildtools/background.html.tmpl --- adblock-plus-2.4+dfsg/buildtools/background.html.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/background.html.tmpl 2014-04-22 06:28:36.000000000 +0000 @@ -0,0 +1,9 @@ + + +{%- for script in backgroundScripts %} + +{%- endfor %} + + + + diff -Nru adblock-plus-2.4+dfsg/buildtools/bootstrap.js.tmpl adblock-plus-2.6+dfsg/buildtools/bootstrap.js.tmpl --- adblock-plus-2.4+dfsg/buildtools/bootstrap.js.tmpl 2013-10-10 19:04:38.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/bootstrap.js.tmpl 2014-04-22 06:28:36.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of the Adblock Plus build tools, - * Copyright (C) 2006-2013 Eyeo GmbH + * Copyright (C) 2006-2014 Eyeo GmbH * * Adblock Plus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as @@ -20,7 +20,7 @@ const Cr = Components.results; const Cu = Components.utils; -let {Services, atob, btoa, File} = Cu.import("resource://gre/modules/Services.jsm", null); +let {Services, atob, btoa, File, TextDecoder, TextEncoder} = Cu.import("resource://gre/modules/Services.jsm", null); {%- if hasXMLHttpRequest %} let XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsIXMLHttpRequest"); diff -Nru adblock-plus-2.4+dfsg/buildtools/build.py adblock-plus-2.6+dfsg/buildtools/build.py --- adblock-plus-2.4+dfsg/buildtools/build.py 2013-10-10 19:04:38.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/build.py 2014-04-22 06:28:36.000000000 +0000 @@ -1,7 +1,7 @@ # coding: utf-8 # This file is part of the Adblock Plus build tools, -# Copyright (C) 2006-2013 Eyeo GmbH +# Copyright (C) 2006-2014 Eyeo GmbH # # Adblock Plus is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as @@ -18,7 +18,7 @@ import os, sys, re, subprocess, buildtools from getopt import getopt, GetoptError -knownTypes = ('gecko', 'chrome', 'opera') +knownTypes = ('gecko', 'chrome', 'opera', 'safari') class Command(object): name = property(lambda self: self._name) @@ -200,6 +200,10 @@ packager.createBuild(baseDir, type=type, outFile=outFile, buildNum=buildNum, releaseBuild=releaseBuild, keyFile=keyFile, experimentalAPI=experimentalAPI) + elif type == 'safari': + import buildtools.packagerSafari as packager + packager.createBuild(baseDir, type=type, outFile=outFile, buildNum=buildNum, + releaseBuild=releaseBuild, keyFile=keyFile) def runAutoInstall(baseDir, scriptName, opts, args, type): @@ -425,11 +429,11 @@ command.params = '[options] [output_file]' command.addOption('Only include the given locales (if omitted: all locales not marked as incomplete)', short='l', long='locales', value='l1,l2,l3', types=('gecko')) command.addOption('Use given build number (if omitted the build number will be retrieved from Mercurial)', short='b', long='build', value='num') - command.addOption('File containing private key and certificates required to sign the package', short='k', long='key', value='file', types=('gecko', 'chrome', 'opera')) + command.addOption('File containing private key and certificates required to sign the package', short='k', long='key', value='file', types=('gecko', 'chrome', 'opera', 'safari')) command.addOption('Create a build for leak testing', short='m', long='multi-compartment', types=('gecko')) command.addOption('Create a release build', short='r', long='release') command.addOption('Enable use of experimental APIs', long='experimental') - command.supportedTypes = ('gecko', 'chrome', 'opera') + command.supportedTypes = ('gecko', 'chrome', 'opera', 'safari') with addCommand(runAutoInstall, 'autoinstall') as command: command.shortDescription = 'Install extension automatically' diff -Nru adblock-plus-2.4+dfsg/buildtools/chainedconfigparser.py adblock-plus-2.6+dfsg/buildtools/chainedconfigparser.py --- adblock-plus-2.4+dfsg/buildtools/chainedconfigparser.py 2013-10-10 19:04:38.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/chainedconfigparser.py 2014-04-22 06:28:36.000000000 +0000 @@ -1,7 +1,7 @@ # coding: utf-8 # This file is part of the Adblock Plus build tools, -# Copyright (C) 2006-2013 Eyeo GmbH +# Copyright (C) 2006-2014 Eyeo GmbH # # Adblock Plus is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as diff -Nru adblock-plus-2.4+dfsg/buildtools/chromeDevenvPoller__.js.tmpl adblock-plus-2.6+dfsg/buildtools/chromeDevenvPoller__.js.tmpl --- adblock-plus-2.4+dfsg/buildtools/chromeDevenvPoller__.js.tmpl 2013-10-10 19:04:38.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/chromeDevenvPoller__.js.tmpl 2014-04-22 06:28:36.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of the Adblock Plus build tools, - * Copyright (C) 2006-2013 Eyeo GmbH + * Copyright (C) 2006-2014 Eyeo GmbH * * Adblock Plus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as diff -Nru adblock-plus-2.4+dfsg/buildtools/chromeInfo.js.tmpl adblock-plus-2.6+dfsg/buildtools/chromeInfo.js.tmpl --- adblock-plus-2.4+dfsg/buildtools/chromeInfo.js.tmpl 2013-10-10 19:04:38.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/chromeInfo.js.tmpl 2014-04-22 06:28:36.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of the Adblock Plus build tools, - * Copyright (C) 2006-2013 Eyeo GmbH + * Copyright (C) 2006-2014 Eyeo GmbH * * Adblock Plus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as diff -Nru adblock-plus-2.4+dfsg/buildtools/.hgsubstate adblock-plus-2.6+dfsg/buildtools/.hgsubstate --- adblock-plus-2.4+dfsg/buildtools/.hgsubstate 2013-10-10 19:04:38.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/.hgsubstate 2014-04-22 06:28:36.000000000 +0000 @@ -1 +1 @@ -6737deead473f5b2290c3e039e935669d732ded1 jshydra +77e57ef745092d07ae5d2d05d61f964790332252 jshydra diff -Nru adblock-plus-2.4+dfsg/buildtools/imageConversion.py adblock-plus-2.6+dfsg/buildtools/imageConversion.py --- adblock-plus-2.4+dfsg/buildtools/imageConversion.py 1970-01-01 00:00:00.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/imageConversion.py 2014-04-22 06:28:36.000000000 +0000 @@ -0,0 +1,135 @@ +# coding: utf-8 + +# This file is part of the Adblock Plus build tools, +# Copyright (C) 2006-2014 Eyeo GmbH +# +# Adblock Plus is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# Adblock Plus is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Adblock Plus. If not, see . + +import os +import re +from StringIO import StringIO + +try: + from PIL import Image + from PIL import ImageOps +except ImportError: + import Image + import ImageOps + +def get_alpha(image): + if image.mode in ('RGBA', 'LA'): + return image.split()[image.getbands().index('A')] + + if image.mode == 'P': + transparency = image.info.get('transparency') + + if transparency is not None: + table = [255] * 256 + table[transparency] = 0 + + return image.point(table, 'L') + +def load_image(path): + image = Image.open(path) + # Make sure the image is loaded, some versions of PIL load images lazily. + image.load() + return image + +def ensure_same_mode(im1, im2): + # if both images already have the same mode (and palette, in + # case of mode P), don't convert anything. Images with mode P, + # and a different palette, are the only case where images + # using the same mode, will be incompatible with each other. + if im1.mode == im2.mode and (im1.mode != 'P' or im1.getpalette() == im2.getpalette()): + return (im1, im2) + + # if any given image has a mode that supports colors convert both + # images to RGB or RGBA, otherwise convert both images to L or LA. + # If any given image has an alpha channel (or mode P which + # can store transparent pixels too) convert both images + # to RGBA or LA, otherwise convert both images to RGB or L. + mode = max( + Image.getmodebase(im1.mode), + Image.getmodebase(im2.mode), + + key=('L', 'RGB').index + ) + + if any(im.mode in ('RGBA', 'LA', 'P') for im in (im1, im2)): + mode += 'A' + + return ( + im1 if im1.mode == mode else im1.convert(mode), + im2 if im2.mode == mode else im2.convert(mode), + ) + +def filter_grayscale(image, baseDir): + alpha = get_alpha(image) + image = image.convert('L') + + if alpha: + image.putalpha(alpha) + + return image + +def filter_contrastToAlpha(image, baseDir): + alpha = Image.new('L', image.size, 255) + alpha.paste(image, mask=get_alpha(image)) + alpha = ImageOps.invert(alpha) + alpha = ImageOps.autocontrast(alpha) + + return Image.merge('LA', [Image.new('L', image.size), alpha]) + +def filter_blend(image, baseDir, *args): + if len(args) == 2: + filename, opacity = args + + overlay = load_image(os.path.join( + baseDir, + *filename.split('/') + )) + else: + red, green, blue, opacity = args + + overlay = Image.new('RGB', image.size, ( + int(red), + int(green), + int(blue), + )) + + # if the background image has an alpha channel copy it to + # the overlay, so that transparent areas stay transparent. + alpha = get_alpha(image) + if alpha: + overlay.putalpha(alpha) + + image, overlay = ensure_same_mode(image, overlay) + return Image.blend(image, overlay, float(opacity)) + +def convertImages(params, files): + metadata = params['metadata'] + + for filename, chain in metadata.items('convert_img'): + baseDir = os.path.dirname(metadata.option_source('convert_img', filename)) + steps = re.split(r'\s*->\s*', chain) + image = load_image(os.path.join(baseDir, *steps.pop(0).split('/'))) + + for step in steps: + filter, args = re.match(r'([^(]+)(?:\((.*)\))?', step).groups() + args = re.split(r'\s*,\s*', args) if args else () + image = globals()['filter_' + filter](image, baseDir, *args) + + f = StringIO() + f.name = filename + image.save(f) + files[filename] = f.getvalue() diff -Nru adblock-plus-2.4+dfsg/buildtools/Info.plist.tmpl adblock-plus-2.6+dfsg/buildtools/Info.plist.tmpl --- adblock-plus-2.4+dfsg/buildtools/Info.plist.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/Info.plist.tmpl 2014-04-22 06:28:36.000000000 +0000 @@ -0,0 +1,161 @@ +{%- macro str_or_real(value) -%} +{%- if value is number -%} + {{ value }} +{%- else -%} + {{ value }} +{%- endif -%} +{%- endmacro -%} + + + + + + CFBundleDisplayName + {{ name }} + CFBundleIdentifier + org.adblockplus.{{ basename }} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleShortVersionString + {{ version }} + CFBundleVersion + {{ version }} + Chrome + + Database Quota + 104857600 + Global Page + background.html + {%- if menus %} + Menus + + {%- for identifier, items in menus.iteritems() %} + + Identifier + {{ identifier }} + Menu Items + + {%- for identifier, props in items.iteritems() %} + + Identifier + {{ identifier }} + {%- for key, value in props.iteritems() %} + {{ key }} + {{ str_or_real(value) }} + {%- endfor %} + + {%- endfor %} + + + {%- endfor %} + + {%- endif %} + {%- if popovers %} + Popovers + + {%- for identifier, props in popovers.iteritems() %} + + Identifier + {{ identifier }} + {%- for key, value in props.iteritems() %} + {{ key }} + {{ str_or_real(value) }} + {%- endfor %} + + {%- endfor %} + + {%- endif %} + {%- if toolbarItems %} + Toolbar Items + + {%- for identifier, props in toolbarItems.iteritems() %} + + Identifier + {{ identifier }} + Label + {{ name }} + {%- for key, value in props.iteritems() %} + {{ key }} + {{ str_or_real(value) }} + {%- endfor %} + + {%- endfor %} + + {%- endif %} + + {%- if startScripts or endScripts %} + Content + + Scripts + + {%- if startScripts %} + Start + + {%- for script in startScripts %} + {{ script }} + {%- endfor %} + + {%- endif %} + {%- if endScripts %} + End + + {%- for script in endScripts %} + {{ script }} + {%- endfor %} + + {%- endif %} + + + {%- endif %} + ExtensionInfoDictionaryVersion + 1.0 + Permissions + + Website Access + + {%- if allowedDomains and not allowAllDomains %} + Allowed Domains + + {%- for domain in allowedDomains %} + {{ domain }} + {%- endfor %} + + {%- endif %} + Include Secure Pages + {%- if allowSecurePages %} + + {%- else %} + + {%- endif %} + Level + {%- if allowAllDomains %} + All + {%- elif allowedDomains %} + Some + {%- else %} + None + {%- endif %} + + + Description + {{ description }} + {%- if author %} + Author + {{ author }} + {%- endif %} + {%- if homepage %} + Website + {{ homepage }} + {%- endif %} + {%- if not releaseBuild or updateURL %} + Update Manifest URL + + {%- if not releaseBuild -%} + https://adblockplus.org/devbuilds/{{ basename }}/updates.plist + {%- else -%} + {{ updateURL }} + {%- endif -%} + + {%- endif %} + + diff -Nru adblock-plus-2.4+dfsg/buildtools/install.rdf.tmpl adblock-plus-2.6+dfsg/buildtools/install.rdf.tmpl --- adblock-plus-2.4+dfsg/buildtools/install.rdf.tmpl 2013-10-10 19:04:38.000000000 +0000 +++ adblock-plus-2.6+dfsg/buildtools/install.rdf.tmpl 2014-04-22 06:28:36.000000000 +0000 @@ -2,7 +2,7 @@ + + + + + +

-
    -
  • -
    -

    -
  • -
  • -
    -

    -
  • -
  • -
    -

    -
  • -
- -
+
  • @@ -109,48 +129,8 @@
- - -
-
- - - - - -
-
-
-

- - - -
- - - - - -
- -