Commit graph

59 commits

Author SHA1 Message Date
Kris Maglione
f58d68534e Bug 1353078: Fix broken null check. r=trivial
MozReview-Commit-ID: 6YlqhNnk3Ju
2017-04-06 13:32:31 -07:00
Kris Maglione
56c459b23c Bug 1350522: Part 6 - Cleanup per-api-instance state logic. r=aswan
MozReview-Commit-ID: 5ixBA34fvFf

--HG--
extra : source : 650808cfe044339ceae30dbd79ef931330f78049
extra : histedit_source : 30316d0b7321bdceaf93fa9dde096579b6251354
2017-03-25 11:36:56 -07:00
Kris Maglione
bb351ebfca Bug 1350522: Part 2 - Convert toolkit APIs to lazy loading. r=aswan
MozReview-Commit-ID: 8TbTIM4WX2d

--HG--
extra : source : a3ed5ad1bc338e7fd8055c2efcf73695c25e09e5
2017-03-31 19:36:00 -07:00
Luca Greco
570c35f5a0 Bug 1291737 - Added a new helper to create windowless extension pages. r=kmag
MozReview-Commit-ID: CqpWgFGmJAt

--HG--
extra : rebase_source : 4efafc7a529316c7986e372c71527b3d9844997a
2017-01-18 15:14:53 +01:00
Kris Maglione
94213ad506 Bug 1320395: Part 3 - Run WebExtensions in their own process type. r=billm,bobowen
MozReview-Commit-ID: FZ4f1Lda5vh

--HG--
extra : rebase_source : 013dfd2ab5e74097d81b0a2afebd3e02060f5e75
2017-01-12 14:11:47 -08:00
Kris Maglione
c8594e2c87 Bug 1319452: Part 1 - Load background page in private browsing mode during permanent private browsing. r=billm
MozReview-Commit-ID: KXA7xlq8Voc

--HG--
extra : rebase_source : 558e3f979df38b8c43333644611f3902629de2b7
2016-11-22 12:07:59 -08:00
Kris Maglione
7d4520e4ec Bug 1317101 - Part 7b: Run remote extension background pages in a visible window for testing. r=billm
MozReview-Commit-ID: DsgpoYAFKmC

--HG--
extra : rebase_source : f173492f12bdd26b67b217c3cb9d33065e7e2c70
extra : source : 039d63d5fef77d7b77c0a7f9724ec9e6347be09a
2016-11-12 17:09:39 -08:00
Kris Maglione
b6d9dc9190 Bug 1317101 - Part 5: Simply remote view initialization code, and fix some inconsistent handling. r=billm
MozReview-Commit-ID: 65BE0oF3rpI

--HG--
extra : rebase_source : c65b403f2960edaf6e5e46ee94d76c39f8507dba
extra : source : 225ad2535585ff6ce38e1e9f8fe5371194a70658
2016-11-12 16:13:21 -08:00
Wes Kocher
4e5f6472fd Backed out 15 changesets (bug 1317101) for e10s jsreftest failures a=backout CLOSED TREE
Backed out changeset 17757ba4c0e8 (bug 1317101)
Backed out changeset 61f8a4084bbd (bug 1317101)
Backed out changeset a8cdc81cdcce (bug 1317101)
Backed out changeset e06d269a5d4f (bug 1317101)
Backed out changeset 1e1bfb578dcd (bug 1317101)
Backed out changeset 0f8144296a9d (bug 1317101)
Backed out changeset b7892d3fb0ca (bug 1317101)
Backed out changeset 039d63d5fef7 (bug 1317101)
Backed out changeset ef7e061b37bf (bug 1317101)
Backed out changeset af7b81d7a5cc (bug 1317101)
Backed out changeset 225ad2535585 (bug 1317101)
Backed out changeset b0521588011d (bug 1317101)
Backed out changeset 07321664430a (bug 1317101)
Backed out changeset 47d283897283 (bug 1317101)
Backed out changeset ffc63be3557c (bug 1317101)
2016-11-16 16:44:30 -08:00
Kris Maglione
29dc4b6832 Bug 1317101 - Part 7b: Run remote extension background pages in a visible window for testing. r=billm
MozReview-Commit-ID: DsgpoYAFKmC

--HG--
extra : rebase_source : cd7a75188b2776436ae11fa4b9c922d0d5fbb759
2016-11-12 17:09:39 -08:00
Kris Maglione
3cb07fc3a1 Bug 1317101 - Part 5: Simply remote view initialization code, and fix some inconsistent handling. r=billm
MozReview-Commit-ID: 65BE0oF3rpI

--HG--
extra : rebase_source : 0c320b6c6c94576a0fc20d1117bf9d76c716c0f2
2016-11-12 16:13:21 -08:00
Matthew Wein
5f0528a1ec Bug 1252871 - Add support for runtime.onInstalled r=aswan
MozReview-Commit-ID: 3wDtv0g0BpO

--HG--
extra : rebase_source : c5d50e41e4cf241b2c3d021e8c2283d4251b7118
2016-10-19 10:38:29 +01:00
Rob Wu
2b7962648c Bug 1287007 - Remove dead code r=billm
MozReview-Commit-ID: LtuKY5DjB68

--HG--
extra : rebase_source : d79d45cef78822977766f67f2172239d523a7182
2016-09-06 15:50:50 -07:00
Rob Wu
dce0635037 Bug 1287007 - Use IPC to share viewType, tabId and windowId r=billm
Accessing <browser> in ContentChild does not work when extensions run in
a separate process.

MozReview-Commit-ID: EK0aOYeGaZ5

--HG--
extra : rebase_source : 359cb1f9022b8097d27aa74a30e133c4a7e7c742
2016-09-06 15:25:10 -07:00
Rob Wu
ff65d297cc Bug 1287007 - Move extension context initialization to ExtensionContent r=billm
This is a simple move of ExtensionContext creation logic to
ExtensionChild.

Before the change, ExtensionContext was initialized as follows:

1. (ext-backgroundPage.js) Create background page
2. (Extension.jsm) document-element-inserted observed.
3. (Extension.jsm) new ExtensionContext + unload observer.

After this commit:

1. (ext-backgroundPage.js) Create background page
2. (ext-backgroundPage.js) emit extension-browser-inserted event
3. (Extension.jsm) Pass global to ExtensionContent + unload listener.
4. (ExtensionContent.jsm) document-element-inserted observed.
5. (ExtensionChild.jsm) new ExtensionContext

The next step is to use frame scripts and synchronize state.

MozReview-Commit-ID: K6mPdq7KQ2T

--HG--
extra : rebase_source : c742dfe89646d6717da134c7408aa5a066107c66
2016-09-05 23:50:11 -07:00
Rob Wu
c68c40357a Bug 1287007 - Move background page API logic to child r=billm
MozReview-Commit-ID: iGROahhkhn

--HG--
extra : rebase_source : c05e46aab941feb017eae8b92d02e7b38ac5f347
2016-09-05 22:34:44 -07:00
Rob Wu
be3652cd57 Bug 1287010 - Make environment of Context explicit. r=billm
- Add `envType` to BaseContext.
 - Pass an explicit envType to all `registerSchemaAPI` invocations.
 - The factories passed to `registerSchemaAPI` will be split up later, so
   that content scripts (`content_child`) and addon pages can share
   common implementations.
 - The factories that implement the addon API will also be split up,
   to separate code running in the main process (`addon_parent`) from
   code running in a child process (`addon_child`).
 - Remove the use of a hardcoded list of `namespaces` from ProxyContext.
   Now `envType` is used to specify whether an API should be activated.

MozReview-Commit-ID: Jiff8HIwG92

--HG--
extra : rebase_source : 946a3c0009a4e3223c2d10044b3099a94c845394
2016-08-16 15:51:50 -07:00
Kris Maglione
c2bdf6f2ff Bug 1296934: Prevent background pages from showing up in global history. r=gabor
MozReview-Commit-ID: GRIJwCsfqVB

--HG--
extra : rebase_source : c58ac81f7eaab5e88cd701cd9949a8d6c064ddc6
extra : amend_source : 3aee83ced4a164ad1cf15be554820552593898ca
2016-08-21 12:43:50 -07:00
Rob Wu
bacc209644 Bug 1295082 - Put Extension in BaseContext r=kmag
ExtensionContext in Extension.jsm has |extension| as an instance member,
so use it instead of passing |extension| to registerSchemaAPI's
callback.

And to make sure that this pattern also works in content processes, move
the |extension| member to BaseContext.

MozReview-Commit-ID: BgsGGCPQxJR

--HG--
extra : rebase_source : 7aa9fb7a53e057e8d3d8c477bd6821f8344c571a
2016-08-15 01:04:58 -07:00
Sebastian Hengst
2164cd95c8 Backed out changeset 0ce1cc39aa3d (bug 1295082) for timing out in test_ext_schemas_api_injection.js. r=backout 2016-08-18 16:47:09 +02:00
Rob Wu
dfc11d6f00 Bug 1295082 - Put Extension in BaseContext r=kmag
ExtensionContext in Extension.jsm has |extension| as an instance member,
so use it instead of passing |extension| to registerSchemaAPI's
callback.

And to make sure that this pattern also works in content processes, move
the |extension| member to BaseContext.

MozReview-Commit-ID: BgsGGCPQxJR

--HG--
extra : rebase_source : 9a85d95f0c147198938b86c57127f6e7403fd53c
2016-08-15 01:04:58 -07:00
Luca Greco
eab2b0ad2c Bug 1268773 - Notify Addon Listeners when the preferred addon debug global is changed. r=aswan
MozReview-Commit-ID: Hn7jb8Kni2J

--HG--
extra : rebase_source : db4a2545950e3b8d32808475ea4b16bd88c43272
2016-07-07 16:29:36 +02:00
Kris Maglione
fba8996a05 Bug 1274775 - Make sure background pages are created with a PresShell. r=billm
MozReview-Commit-ID: GLWg5aK47g5

--HG--
extra : rebase_source : 472365762aca534e826173989c48f5058960a987
2016-07-24 15:09:07 -07:00
Rob Wu
f8554fe4b9 Bug 1234677 - Introduce _generated_background_page.html r=billm
- Fixes bugzil.la/1234677
- Fixes bugzil.la/1286057
- Fixes bug: the URL failed to load if a query string or reference
  fragment was present.

MozReview-Commit-ID: 4oMwI3IS7OX

--HG--
extra : rebase_source : 621878e4f62febdc34899192e254f8ec315b789e
2016-07-12 13:55:14 -07:00
Rob Wu
0211115bf6 Bug 1234677 - Overwrite alert at window init instead of onload r=billm
A nice extra effect of this is that it will also work after reloading
the background page (location.reload()) and it should also work for
child frames in background pages.

MozReview-Commit-ID: ErvpzD8d3ow

--HG--
extra : rebase_source : 2057ecc805c8d8c8e724743a11c01362fa0cf5bc
2016-07-20 01:00:29 -07:00
Iris Hsiao
d677544a02 Backed out changeset 4dd2466573ec (bug 1234677) for Mochitest test_chrome_ext_background_page.html failure 2016-07-20 12:54:00 +08:00
Rob Wu
feb2e74708 Bug 1234677 - Introduce _generated_background_page.html r=billm
- Fixes bugzil.la/1234677
- Fixes bugzil.la/1286057
- Fixes bug: the URL failed to load if a query string or reference
  fragment was present.

MozReview-Commit-ID: 4oMwI3IS7OX

--HG--
extra : rebase_source : 60096dd421d18c0991f807a6f07eb72be10109dd
2016-07-12 13:55:14 -07:00
Kris Maglione
a1dac7caad Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS

--HG--
extra : source : a00cf073f5c00380d4e42b13bc0cd3146b708845
extra : amend_source : d74ef90e88acbe62e33af3b5b9cf870d5c0a9d3e
2016-06-09 17:44:47 -07:00
Sebastian Hengst
f8035f62a8 Backed out changeset a00cf073f5c0 (bug 1279392) for failing mochitest test_ext_contentscript_create_iframe.html at least on Linux x64 opt. r=backout 2016-06-14 13:37:52 +02:00
Kris Maglione
b465305345 Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS

--HG--
extra : rebase_source : cba877c0ef400917b0b7e5913895e64ebefb34b9
extra : amend_source : 6e943015e3e00854c431cbd653994a6734e66ce4
2016-06-09 17:44:47 -07:00
Kris Maglione
c98153037d Bug 1276025: Stop using injectInDocShell to tag docShells with types. r=billm
MozReview-Commit-ID: 7h5PI2birY4

--HG--
extra : source : 99b213f494e1a9e20629e936681faedec16d22a3
extra : amend_source : d70ffaecbc11445a5bddeb52c9c940a866934347
2016-06-02 20:53:41 -07:00
Wes Kocher
3ec856c177 Backed out changeset 99b213f494e1 (bug 1276025) for xpcshell bustage CLOSED TREE 2016-06-07 16:59:20 -07:00
Kris Maglione
c5d392a9bc Bug 1276025: Stop using injectInDocShell to tag docShells with types. r=billm
MozReview-Commit-ID: 7h5PI2birY4

--HG--
extra : rebase_source : a8b8b9b49f9ef8304ee669f6c28c9290a1198ff3
extra : amend_source : f868dc11e3da5f89852343e88e373db14f5dcbd3
extra : histedit_source : 6ee59978a58828e22a9f2cbf651cb713ba28d25d
2016-06-02 20:53:41 -07:00
tofumatt
b5aa4919a7 Bug 1203394 - Fix eslint errors in alert() patch. r=Aryx
MozReview-Commit-ID: KRUJflBrkxa
2016-04-25 15:16:32 +01:00
tofumatt
efbcce4925 bug 1203394: alias alert() to console.log() in background scripts r=kmag
MozReview-Commit-ID: 65m3yVGQhlQ
***
Add test and fix nitpicks to alert() patch

--HG--
extra : rebase_source : 4b5ec2a09bce49bca6c419b2ece59160c282da94
2016-03-22 12:35:31 +00:00
Bill McCloskey
74d6b169e1 Bug 1197346 - Rename ExtensionPage to ExtensionContext (r=kmag) 2016-04-23 20:04:29 -07:00
Johann Hofmann
1c76cac853 Bug 1005193 - Allow addons to specify a custom global debug context. r=mossop 2016-04-11 08:26:20 +02:00
Carsten "Tomcat" Book
e46b14d4df Backed out changeset 387bd412040f (bug 1005193) for test failures in Android 4.3 API15+ debug Mochitest Chrome 2016-04-14 11:31:17 +02:00
Johann Hofmann
eb48aa54c0 Bug 1005193 - Allow addons to specify a custom global debug context. r=mossop 2016-04-11 08:26:20 +02:00
Kris Maglione
dce2b3c2cd Bug 1214955: [webext] Automatically localize all localizable manifest properties. r=billm
MozReview-Commit-ID: 2kvYT44NIE8

--HG--
extra : rebase_source : ebab864b517c2e576dde27cf1439cf2deadb0685
2016-02-29 19:34:49 -08:00
Kris Maglione
ba2e5f60f4 Bug 1248855 - [webext] Add "object-curly-spacing" ESLint rule and auto-fix errors. r=billm
MozReview-Commit-ID: BAZ2rRl7eSM
2016-02-16 20:10:00 -08:00
Kris Maglione
f0a1600d9a Bug 1234020: Part 2a - [webext] Return promises from the background page APIs. r=rpl
--HG--
extra : commitid : 6QaVA3XIUzC
extra : rebase_source : a769506ee88b7ac0e4b972c26750409adec5239c
extra : histedit_source : 1768cb7a91aa363ee2ea0d5094ad8e5a18eb9605
2016-02-02 19:14:34 -08:00
Kris Maglione
ccbc83560c Bug 1239822: Part 2a - [webext] Explicitly destroy windowless browsers on unload. r=billm
--HG--
extra : commitid : JXAapKEd31v
extra : rebase_source : 729fa88d1d0e8c91a47745af00fb321866eb1063
2016-01-15 13:30:15 -08:00
Kris Maglione
9e41dc86fa Bug 1239884: Follow-up: Fix ESLint error.
--HG--
extra : commitid : foilvht5yL
2016-01-15 19:49:30 -08:00
Kris Maglione
276df1ae5c Bug 1239884: Part 1 - [webext] Don't create an extra API context for background pages. r=billm
--HG--
extra : commitid : ESaeR89QQR1
extra : rebase_source : 63e76105c40ef5204a655be9711d045be36e775d
2016-01-14 16:23:10 -08:00
Bill McCloskey
c15d73943a Bug 1224105 - [webext] Use <browser> element for background page (r=kmag) 2015-12-23 12:29:39 -08:00
Bill McCloskey
b8196d4c71 Bug 1208257 - [webext] runtime.json (r=kmag) 2015-12-23 08:57:13 -08:00
Bill McCloskey
1b98762630 Bug 1208257 - [webext] extension.json (r=kmag) 2015-12-23 08:57:13 -08:00
Kris Maglione
b729a30707 Bug 1229874: Part 3 - Enable ESLint in WebExtension code. r=billm
The base .eslintrc is essentially a merge of the root Toolkit .eslintrc and
the devtools .eslintrc, with some minor changes to match our prevalent style.

For the most enforces the coding styles that we've been using most
consistently. There are a couple of significant differences, though:

 * The rule for opening brace alignment can only be applied globally, and
   doesn't make exceptions for top-level functions. I chose to turn it on, and
   change the brace style of existing top-level functions that violated it,
   since the rule seemed worth using, and that's the direction most Toolkit JS
   code has been headed anyway.

 * The rule for switch/case statements requires an added indentation level for
   case statements. Most of our switch statements did not use an extra level
   of indentation, and I initially wrote the rule to enforce that style, until
   I came across case statements that used blocks, and required the extra
   indentation level for sanity.

--HG--
rename : devtools/.eslintrc => toolkit/components/extensions/.eslintrc
extra : commitid : 4aDZOi5MNPc
extra : rebase_source : f34ba43aeb8046a0c971cb76b76410497bd12b42
extra : source : 2a7eb4ef7b375e5fd52d843ca206a071367a6475
2015-12-02 16:58:53 -08:00
Kris Maglione
9b2c61cbae Bug 1215893: [webext] Check capturing event listeners for the correct target. r=billm
--HG--
extra : commitid : IYgT9fAiHJX
extra : rebase_source : c672622b7f2e931ceab45b5569c9de0bfd40602a
2015-11-14 23:30:52 -08:00