Commit Graph

217 Commits

Author SHA1 Message Date
Alexandre Poirot
ec7febe16f Bug 1185460 - Implements AddonManager.installAddonFromSources to install addon from sources permanently. r=rhelmer
MozReview-Commit-ID: LYEFnVUPhtX

--HG--
extra : rebase_source : b50e78579cd275f334f20611255bee1699149d23
2016-09-27 02:36:23 -07:00
Andrew Swan
64e9612631 Bug 1308261 Add hash to options for mozAddonManager.createInstall() r=bz,kmag
MozReview-Commit-ID: Dx4Giy5k26c

--HG--
extra : rebase_source : 3a612b5586a5ae7e726ba2cf7840ca15bbab8a90
2016-10-06 17:50:55 -07:00
Andrew Swan
8fbeb75129 Bug 1303418 Don't allow upgrades that change the addon ID r=mossop
MozReview-Commit-ID: JHINo8ShmeI

--HG--
extra : source : 9a74c400ed6c62d5fc6abe0cd42d27be70f18f02
extra : amend_source : 8776cfb584840bccc817ce1fda00d04b236875eb
extra : intermediate-source : 8490362e38cdaa930985a5adafc581d7bb76fe45
2016-09-16 15:00:18 -07:00
Andrew Swan
4297232844 Bug 1297028 Expose Addon.canUninstall flag to content r=bz,rhelmer
MozReview-Commit-ID: Ec6QPj9h9k7

--HG--
extra : rebase_source : 747cb4ce54d5e8d0cc7bc2cc3654471b3b07bfcb
2016-08-23 19:24:15 -07:00
Robert Helmer
bcf92a01fd Bug 1279012 - implement onUpdateAvailable and runtime.reload() for WebExtensions r=aswan
MozReview-Commit-ID: KywrVkcRhzp

--HG--
extra : rebase_source : e51f67f76f3b3ac845b2d2f3ba8c36005c43c2c1
2016-08-02 09:37:01 -07:00
Wil Clouser
3315f2a277 Bug 1288178 - add Test Pilot to mozAddonManager allow list r=rhelmer
MozReview-Commit-ID: Klx75vFhKUI

--HG--
extra : rebase_source : d488675eea0504b4af4fd1cb9278a44bb9564fbe
2016-08-09 15:15:01 -07:00
Jared Wein
fd84c776c7 Bug 1292042 - Enable the keyword-spacing rule for eslint. Most of this patch was autogenerated by 'eslint --fix'. Files with .xml extension needed to be changed by hand due to limitations of custom plugin. r=markh
MozReview-Commit-ID: EMjJ3yWt9Wt

--HG--
extra : rebase_source : 2b8327e5a7cf0bfd190d696ad5fe475f13faa3cc
2016-08-04 03:28:58 -04:00
Andrew Swan
e8c3e2138f bug 1287125 Lock down mozAddonManager.install() r=rhelmer
MozReview-Commit-ID: 7wLqVme2Yzi

--HG--
extra : rebase_source : 870ddfc2a92599b3ce6f8ab1b850f8bde944575e
2016-07-15 11:40:45 -07:00
Carsten "Tomcat" Book
14a7e12166 Backed out changeset fbf164ef9e70 (bug 1287125) for perma failing in browser_webapi_install.js after merged 2016-07-18 09:06:42 +02:00
Andrew Swan
741c775523 bug 1287125 Lock down mozAddonManager.install() r=rhelmer
MozReview-Commit-ID: 7wLqVme2Yzi

--HG--
extra : rebase_source : 1eeee0567b7977e00c68467546cf77e5c4f3577c
2016-07-15 11:40:45 -07:00
Andrew Swan
ba6d7750b6 Bug 1279034 Add Addon.setEnabled() for a.m.o r=rhelmer,smaug
MozReview-Commit-ID: 6mvHMWinkle

--HG--
extra : rebase_source : 6d6f564d50dbcea8850c3fd6117351c2efe2cb6c
2016-06-24 12:54:18 -07:00
Robert Helmer
c131308082 Bug 1231172 - provide API for add-ons to delay restartless updates r=aswan
MozReview-Commit-ID: 9nzqEdx4h3p

--HG--
extra : rebase_source : 131201c80532c44a12cd59ee9d7616f6c79cf33e
2016-06-07 15:57:14 -07:00
Andrew Swan
87981b40e1 Bug 1255041 - Implement uninstall() on DOM Addon objects. r=rhelmer
MozReview-Commit-ID: Ad3r78Y9IKb

--HG--
extra : rebase_source : 6a5f0d85b5c13138d6df57c9d5f6233aa10868bb
2016-04-21 09:59:14 -07:00
Andrew Swan
dc4b339b75 Bug 1255040 - Implement mozAddonManager.createInstall(). r=rhelmer
MozReview-Commit-ID: JLrhGywROzt

--HG--
extra : transplant_source : h%01%A8%D1%89%C0IO%1E%879C%01%25%ECW%1Dg%1D%7C
2016-04-18 13:48:12 -07:00
Dave Townsend
9885c5b8b1 Bug 1245571: Allow AMO to be able to query details about an add-on. r=rhelmer
This adds a bunch of structure supporting a promise-based API on the
AddonManager object that is exposed to webpages and adds the first example,
getAddonByID.

MozReview-Commit-ID: CCEFl4R1o81

--HG--
extra : rebase_source : 6206982c687a8e1733ef323488fc2710a4967688
2016-03-10 09:50:07 -08:00
Dave Townsend
5a830b3dbf Bug 1257246: Update toolkit/mozapps/extensions for eslint 2. r=aswan
Most of this is fixing functions that in some cases return a value but then
can also run to completion without returning anything. ESLint 2 catches this
where previous versions didn't. Unless there was an obvious other choice I just
made these functions return undefined at the end which is effectively what
already happens.

MozReview-Commit-ID: CRpZy873GP6

--HG--
extra : rebase_source : d355e5f0f13211cbd81e2a91cfe6191f5e84adb2
extra : histedit_source : eb85af7438b493a22fd9a4c32ab254e6a01b7cb3
2016-04-05 11:32:12 -07:00
Kris Maglione
5de19cb803 Bug 1250784: Part 1 - [webext] Add support for options_ui via inline browsers in the Add-on Manager. r=Mossop
MozReview-Commit-ID: 9a999BJvDHD

--HG--
extra : rebase_source : b2db687cfae8fd8dabaa0a7c15a828d15258de6a
2016-03-09 16:50:08 -08:00
Robert Helmer
4329bf0e41 Bug 1249689 - generate and provide a Symbol for each add-on on startup r=mossop
MozReview-Commit-ID: LoPGSrJtlkr

--HG--
extra : rebase_source : e2ce9f017213bce7b78567df7f086d36fe14229a
2016-01-11 15:35:19 -08:00
Dave Townsend
5732b53ed9 Bug 1250639: Remove the nsIPrincipal shim for the older API style. r=rhelmer
MozReview-Commit-ID: DyX66KlOLCC

--HG--
extra : rebase_source : 4097d74a428dda7919cc30ad2500bcb48c4427af
2016-02-23 12:11:37 -08:00
Dave Townsend
424899c3cd Bug 1245916: Turn on no-undef in toolkit/mozapps/extensions. r=rhelmer
Mostly just declaring globals that Cu.imports defines but there are some actual
bugs here that have been fixed as well as one test that just never ran because
of a hidden exception.

MozReview-Commit-ID: J6uIpYp8ANx

--HG--
extra : rebase_source : 5c19b92e4242088b6fc7a268f255fe9a795928f6
extra : source : 3e5b6df276a9a20fe7b3655656e62a09bc46aaa9
2016-02-03 22:48:48 -08:00
Dave Townsend
c56db4025e Backed out changeset 3e5b6df276a9 from bug 1245916 for causing test failures.
MozReview-Commit-ID: CbsTB3xqGC6
2016-02-15 11:36:23 -08:00
Dave Townsend
70e2c0d753 Bug 1245916: Turn on no-undef in toolkit/mozapps/extensions. r=rhelmer
Mostly just declaring globals that Cu.imports defines but there are some actual
bugs here that have been fixed as well as one test that just never ran because
of a hidden exception.

MozReview-Commit-ID: J6uIpYp8ANx

--HG--
extra : rebase_source : 9d33fb313aec69e98ac3027d20a6bfc247f27f63
2016-02-03 22:48:48 -08:00
Andrew Swan
a6117744fc Bug 612168 - Handle uninstalls of restartless addons in XPIProvider. r=Mossop
--HG--
extra : commitid : 1C1yU1DSWZJ
2016-02-05 15:06:48 -08:00
Phil Ringnalda
7f5bfce5de Merge m-i to m-c, a=merge 2016-02-05 18:41:47 -08:00
Tom Schuster
943620b92d Bug 1245141 - Use new Proxy for AddonManager.addonTypes. r=mossop 2016-02-05 19:31:08 +01:00
Dave Townsend
e496a11771 Bug 1245649: Turn on no-extra-semi. r=markh
--HG--
extra : commitid : HReQFPDOA6x
extra : rebase_source : 303a92f511c3c9dd2d26135975d4dc7c85e823b3
2016-02-03 17:27:36 -08:00
Dave Townsend
541b00204a Bug 1245649: Merge browser and toolkit eslint rule settings. r=felipe
--HG--
extra : commitid : DrYPQokQp9O
extra : rebase_source : e0bacf124280ecdbeccfc34dbf66fd80f5a9d296
2016-02-03 13:12:18 -08:00
Robert Helmer
5fb8db01a4 Bug 1231003 - clarify in variable names and comments that temporary add-ons can be files or dirs r=mossop
--HG--
extra : transplant_source : %26%DBzr%14%18J%F0e6%40%5BY%5E%D3%14L%3Cs%3E
2015-12-07 14:53:11 -05:00
Robert Helmer
d4b4a83098 bug 1228792 - remove use of array comprehensions r=mossop
--HG--
extra : commitid : I7JbIRZK5Pk
extra : rebase_source : 516f056afbb164b0b7b9fd9889c5cc998626c15d
extra : histedit_source : da178544faf7ff52591d96712921ddd73de2b48a
2015-12-02 18:40:59 -08:00
Dave Townsend
552c0bb27b Bug 1226386: Remove or fix many uses of Array.forEach. r=rhelmer
--HG--
extra : commitid : BCzc4kuShSp
extra : rebase_source : 8517ce0913bb72ee340cb400e4f45c43bf964d67
2015-11-20 15:31:17 -08:00
Dave Townsend
f946cdabc4 Bug 1226386: Remove use of non-standard __defineGetter__ and __defineSetter__. r=rhelmer
Moved these mostly onto the prototype. We couldn't do this before without making
the target of the wrapper a property of the wrappers and we don't want to expose
that but now WeakMaps allow us to get the target without exposing it.

Once change with this approach is that when the test suite shuts down the
add-ons manager it kills the map and so wrappers cease to function. A couple of
tests were relying on accessing wrapper properties after that but that would
have likely been unsafe anyway.

--HG--
extra : commitid : 6OI6dLyM45D
extra : rebase_source : c8a53360ce582186dcdc5cbf0dfc2b5057881eac
2015-11-20 10:55:13 -08:00
Dave Townsend
f6c6e0cc02 Bug 1226386: Switch to fat arrow functions where it makes sense. r=rhelmer
Both for brevity and to remove the use of |self = this|.

--HG--
extra : commitid : 7gNXRCzxPxM
extra : rebase_source : 4dccdf8bf99f5979664ca3ca3d9e61f66e217bfe
2015-11-20 10:06:14 -08:00
Dave Townsend
e2b946adfc Bug 1226386: Remove functions names where possible. r=rhelmer
We used to need explicit names for functions to make stack traces display
properly. The JS engine is smarter now so doesn't need them and they just
make the code messy and redundant.

--HG--
extra : commitid : 4FEIiQYhRQu
extra : rebase_source : 26689d5417f592d0f327f32076245cb4f154229a
2015-11-19 16:35:41 -08:00
Dave Townsend
c872ff3d33 Bug 1226386: Remove most of the preprocessing from the add-ons manager. r=gps
For build speed, for correct line numbers in errors, for faster development, for so many reasons.
Still a couple of cases left mostly in XUL files for different strings on Windows.

Bonus: The new lexical scope means ADDON_SIGNING and REQUIRE_SIGNING can just
be declared as regular constants and outside code can't get to them easily.

--HG--
extra : commitid : Kj8khjuCwG2
extra : rebase_source : 2e0a3143900c0c414cda43254306f0c070f8e621
2015-11-19 15:30:47 -08:00
Kris Maglione
6713ba9ac7 Bug 1192435: Support updates for WebExtensions. r=Mossop
--HG--
extra : commitid : 2NZYNYBpFs4
extra : rebase_source : 06a5d6fe9b91872f31f17323766e74fc4dc24646
2015-11-17 16:23:15 -08:00
Johann Hofmann
75a90ffc8e Bug 1200674 - Allow flexible icon sizes in ExtensionUtils. r=dtownsend 2015-11-24 18:20:26 +01:00
Robert Helmer
e339903d0b Bug 1209341 - allow loading unsigned restartless add-ons at runtime. r=mossop
--HG--
extra : transplant_source : %9EhX%F7%9D%AE%F5%14%18%E6%3B%A7%D3w%E3%3B%CAl%27%05
2015-11-03 10:07:08 -08:00
Kris Maglione
c663cc0727 Bug 1214058: Part 1 - Add a simplified JSON-based add-on update protocol. r=Mossop
--HG--
extra : commitid : HUFAitZpdVA
extra : rebase_source : b2eb9ede0582b804e1e583570e165e27f42c8fa7
extra : source : a4d5d63a03ef3938d95f629a6a9ea31d3e88627d
2015-11-03 14:49:46 -08:00
Wes Kocher
7a3e94be61 Backed out 2 changesets (bug 1214058) for xpcshell bustage
Backed out changeset 90e625ac70b2 (bug 1214058)
Backed out changeset a4d5d63a03ef (bug 1214058)
2015-11-03 16:06:23 -08:00
Kris Maglione
84b37ed6ea Bug 1214058: Part 1 - Add a simplified JSON-based add-on update protocol. r=Mossop
--HG--
extra : commitid : kx59XtC26O
extra : rebase_source : 95f8fa8f13be16f2353ea3dcaa230a92563e6af6
2015-11-03 14:49:46 -08:00
Johann Hofmann
2225f650f8 Bug 1192432 - Support custom icons in Web Extensions. r=mossop 2015-10-14 11:03:40 +02:00
Tooru Fujisawa
7ff6b0aae3 Bug 1207497 - Part 1: Remove use of expression closure from toolkit/, exept tests. r=Gijs
--HG--
extra : commitid : 7TOGiSg7KEL
extra : rebase_source : e6c1672e9b7e9d18aa4a430051789b5962c0ec14
2015-09-24 21:20:04 +09:00
Dave Townsend
7c204151f3 Bug 1192924: Check for updated system add-ons and download and install them. r=rhelmer
This performs the update check for system add-ons. It runs as part of the daily
add-on update checks similar to hotfix checks. Currently no URL is set so builds
won't actually start checking yet.

I've taken a few shortcuts here by only staging updates and needing a restart to
install as well as always downloading updates rather than using existing local
copies. At least the latter probably needs fixing before turning this on but
it makes more sense to iterate on those in tree.

--HG--
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app1/features/system1@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system1_1.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app3/features/system1@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system1_1_badcert.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app2/features/system1@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system1_2.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app1/features/system2@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system2_1.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app2/features/system3@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system3_1.xpi
extra : commitid : Ex9NNNduxhK
extra : rebase_source : 99088404019f53a8a76105c66edce404f2c7e454
2015-09-10 10:57:39 -07:00
Wes Kocher
468b697f04 Backed out 3 changesets (bug 1192924) for Android bustage CLOSED TREE
Backed out changeset 30d612836685 (bug 1192924)
Backed out changeset a6860f880e01 (bug 1192924)
Backed out changeset 10e1fa2cc23a (bug 1192924)

--HG--
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system1_1.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app1/features/system1@tests.mozilla.org.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system2_1.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app1/features/system2@tests.mozilla.org.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system1_2.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app2/features/system1@tests.mozilla.org.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system3_1.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app2/features/system3@tests.mozilla.org.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system1_1_badcert.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app3/features/system1@tests.mozilla.org.xpi
2015-09-22 11:02:55 -07:00
Dave Townsend
d039cf8d34 Bug 1192924: Check for updated system add-ons and download and install them. r=rhelmer
This performs the update check for system add-ons. It runs as part of the daily
add-on update checks similar to hotfix checks. Currently no URL is set so builds
won't actually start checking yet.

I've taken a few shortcuts here by only staging updates and needing a restart to
install as well as always downloading updates rather than using existing local
copies. At least the latter probably needs fixing before turning this on but
it makes more sense to iterate on those in tree.

--HG--
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app1/features/system1@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system1_1.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app3/features/system1@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system1_1_badcert.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app2/features/system1@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system1_2.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app1/features/system2@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system2_1.xpi
rename : toolkit/mozapps/extensions/test/xpcshell/data/system_addons/app2/features/system3@tests.mozilla.org.xpi => toolkit/mozapps/extensions/test/xpcshell/data/system_addons/system3_1.xpi
extra : commitid : CuRP3svf6aO
extra : rebase_source : 0a67da41a0a7b27ecb042875ebf13b7b69ec5c84
extra : histedit_source : e96ecd9a4a56e503b4df0e2a0ecd1ac82a716a66
2015-09-10 10:57:39 -07:00
Shu-yu Guo
64db2267cf Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
Dave Townsend
2e931bb682 Bug 1192930 - Require a special certificate for system add-ons. r=rhelmer
Makes sure that add-on objects always have the _installLocation property for
the location they will be installed into so that isUsableAddon can test for the
right signature.

--HG--
extra : transplant_source : %9C%C1%AC%13%82%F2%94%18%9F%BC%CD%0C%FC%F65B%0DY%86%3F
2015-08-26 16:14:00 -07:00
Dave Townsend
688ebef0fa Bug 1192921: Refactor add-on manager startup loop to better support validating install locations after scanning. r=rhelmer
The add-ons manager recognises the notion of "install locations". Each location
can contain add-ons that are installed in the application. There are two main
types, directory locations which exist as a directory somewhere in the
filesystem and registry locations which exist in the Windows registry. The
profile location is the one where add-ons installed through the UI exist, the
other locations are for add-ons that are bundled with the application,
installed by the OS or by third-party applications.

Install locations have priorities. The profile location has the highest priority
then the others gradually lower priorities. When an add-on exists in more than
one install location the version in the highest priority location is the one
that is visible and can be active in the application. We still retain details
about the other versions in the database.

On every startup the add-ons manager scans over these install locations to see
if the set of installed add-ons has changed at all. A very quick check is done
to see if the more thorough check in processFileChanges (which synchronously
loads the add-ons database and install manifests for the add-ons) is needed.

The job of processFileChanges is to load information about all the add-ons and
update the add-ons database to match. It has to decide which add-ons to make
visible, track what changes were made to the visible set of add-ons and call
restartless add-ons install and uninstall scripts.

The original version of processFileChanges attempted to optimise this by doing
all of the work in a single loop over the add-ons in the locations. This mostly
worked but made certain situations difficult to handle (see bug 607818 f.e.).
There isn't much need for this level of optimisation. We're already in a slow
pass and once all the data is loaded off the disk looping over it is fast.

This changeset moves processFileChanges into the XPIProviderUtils file which is
lazy loaded when necessary. While most of the code is the same it instead does
one loop to update the database and gather information, then a second loop to
update add-on visibility, record changes and call bootstrap scripts.

--HG--
extra : commitid : CRFjjhiI4Pi
extra : rebase_source : 85091024e331dce72b9d704ca7a962a30d4b8407
2015-08-21 16:49:56 -07:00
Phil Ringnalda
48457bc69c Backed out 4 changesets (bug 1192921) for b2g desktop Gu hangs
Backed out changeset 1bfa2dead61f (bug 1192921)
Backed out changeset f310cab1dd4e (bug 1192921)
Backed out changeset c3009691dfe6 (bug 1192921)
Backed out changeset d8233b994741 (bug 1192921)
2015-09-03 20:53:50 -07:00
Dave Townsend
53b799a110 Bug 1192921: Refactor add-on manager startup loop to better support validating install locations after scanning. r=rhelmer
The add-ons manager recognises the notion of "install locations". Each location
can contain add-ons that are installed in the application. There are two main
types, directory locations which exist as a directory somewhere in the
filesystem and registry locations which exist in the Windows registry. The
profile location is the one where add-ons installed through the UI exist, the
other locations are for add-ons that are bundled with the application,
installed by the OS or by third-party applications.

Install locations have priorities. The profile location has the highest priority
then the others gradually lower priorities. When an add-on exists in more than
one install location the version in the highest priority location is the one
that is visible and can be active in the application. We still retain details
about the other versions in the database.

On every startup the add-ons manager scans over these install locations to see
if the set of installed add-ons has changed at all. A very quick check is done
to see if the more thorough check in processFileChanges (which synchronously
loads the add-ons database and install manifests for the add-ons) is needed.

The job of processFileChanges is to load information about all the add-ons and
update the add-ons database to match. It has to decide which add-ons to make
visible, track what changes were made to the visible set of add-ons and call
restartless add-ons install and uninstall scripts.

The original version of processFileChanges attempted to optimise this by doing
all of the work in a single loop over the add-ons in the locations. This mostly
worked but made certain situations difficult to handle (see bug 607818 f.e.).
There isn't much need for this level of optimisation. We're already in a slow
pass and once all the data is loaded off the disk looping over it is fast.

This changeset moves processFileChanges into the XPIProviderUtils file which is
lazy loaded when necessary. While most of the code is the same it instead does
one loop to update the database and gather information, then a second loop to
update add-on visibility, record changes and call bootstrap scripts.

--HG--
extra : commitid : FAyc1y0WszT
extra : rebase_source : 308a674ec0e3f81ee3e0533b7014c37477860d67
2015-08-21 16:49:56 -07:00