Commit Graph

59 Commits

Author SHA1 Message Date
Andrew Swan
3d501bbfd5 Bug 1369577 Part 1 Rename SingletonEventManager to EventManager r=kmag
MozReview-Commit-ID: 7nsYWdSTJCG
2017-06-09 13:49:07 -07:00
Sebastian Hengst
8642712c2a Backed out changeset 26fd6d0a1254 (bug 1369577) for failing xpcshell's test_ext_simple.js and test_ext_startup_cache.js on Android. r=backout 2017-06-30 01:01:13 +02:00
Andrew Swan
c140bd9d12 Bug 1369577 Part 1 Rename SingletonEventManager to EventManager r=kmag
MozReview-Commit-ID: 7nsYWdSTJCG
2017-06-09 13:49:07 -07:00
Mark Banner
9916415caf Bug 1371292 - Clean up more ESLint global definitions in configuration files in toolkit/ and browser/. r=mossop
MozReview-Commit-ID: 5KC23kzaCFN
2017-06-08 10:59:12 +01:00
Kris Maglione
972b1073af Bug 1368152: Part 4 - Remove ExtensionManagement.jsm. r=aswan
MozReview-Commit-ID: Apbi1QYeb2x
2017-06-03 17:18:18 -07:00
Kris Maglione
4f623b6890 Bug 1322235: Part 3 - Use MatchPatternSet for whiteListedHosts and webRequest. r=aswan,zombie
This is the second step to migrating the policy service to pure native code,
with similar impacts and reasoning to the previous patch.

MozReview-Commit-ID: L5XdPzWNZXM
2017-06-03 22:11:20 -07:00
Shane Caraveo
2a84eab190 Bug 1367138 fix webrequest frameId and parentFrameId, r=aswan
MozReview-Commit-ID: F8lD8vvfSQ5
2017-06-02 12:05:13 -07:00
Kris Maglione
da08b6926c Bug 1317697: Remove things from ExtensionUtils that don't belong there. r=mixedpuppy
MozReview-Commit-ID: CTX0TckLqoV
2017-04-07 13:39:06 -07:00
Kris Maglione
e6a8ac0beb Bug 1355120: Get rid of top-level window ID tracking. r=aswan
MozReview-Commit-ID: y7DzMxXBot
2017-04-12 14:12:22 -07:00
Tomislav Jovanovic
b916f5f3e6 Bug 1345225 - Check if webRequest filters overlap with host permissions r=kmag
MozReview-Commit-ID: 1tMHynv9FBO
2017-03-26 20:53:28 +02:00
Kris Maglione
884009911d Bug 1350522: Part 2 - Convert toolkit APIs to lazy loading. r=aswan
MozReview-Commit-ID: 8TbTIM4WX2d
2017-03-31 19:36:00 -07:00
Tomislav Jovanovic
410a8bbf73 Bug 1311815 - Check host permissions for webRequest listeners r=kmag
MozReview-Commit-ID: 9bcb4p7tP2u
2017-02-16 14:56:35 +01:00
Kris Maglione
1ccc618561 Bug 1260548: Part 5 - Factor out <browser> data logic into shared modules. r=aswan
MozReview-Commit-ID: GHPympWA7U
2017-01-30 20:11:14 -08:00
Shane Caraveo
f094e18e5f Bug 1190689 implement onAuthRequired for WebRequest, r=kmag
MozReview-Commit-ID: D6ydPIMNzDI
2017-01-26 13:40:36 -08:00
Andrew Swan
1ac8741081 Bug 1203330 Part 1 Fix SingletonEventManager r=kmag
This patch adds the ability to run SingletonEventManager handlers in
different modes: sync, async, raw (no exception handling, arg cloning,
or asynchrony), or asyncWithoutClone. When you call the handler,
you're required to specify which variant you want.

Existing uses of SingletonEventManager are all converted to async calls.
Note that some of them were previously synchronous, but it didn't appear
to be necessary.

Also added a callOnClose for SingletonEventManager when the last listener
is removed.

MozReview-Commit-ID: ATHO97dWf3X
2017-01-26 20:00:33 -08:00
Phil Ringnalda
5781d2a09e Backed out 3 changesets (bug 1203330) for failures in test_delay_update_webextension.js
CLOSED TREE

Backed out changeset 2d42350d209a (bug 1203330)
Backed out changeset 3a12c51c3eca (bug 1203330)
Backed out changeset 31fac390e15d (bug 1203330)
2017-01-26 19:13:11 -08:00
Andrew Swan
8e5ca9edb5 Bug 1203330 Part 1 Fix SingletonEventManager r=kmag
This patch adds the ability to run SingletonEventManager handlers in
different modes: sync, async, raw (no exception handling, arg cloning,
or asynchrony), or asyncWithoutClone. When you call the handler,
you're required to specify which variant you want.

Existing uses of SingletonEventManager are all converted to async calls.
Note that some of them were previously synchronous, but it didn't appear
to be necessary.

Also added a callOnClose for SingletonEventManager when the last listener
is removed.

MozReview-Commit-ID: ATHO97dWf3X
2017-01-26 13:43:12 -08:00
Shane Caraveo
166e323191 Bug 1329299 verify frameId in webrequest tests, r=kmag
MozReview-Commit-ID: LuQcGsogs7J
2017-01-12 12:09:35 -08:00
Shane Caraveo
514b6a6f46 Bug 1311576 fix webrequest filter for tabId and windowId, r=kmag
MozReview-Commit-ID: FzW53LXktWz
2016-11-15 16:34:33 -08:00
Kris Maglione
b5f8391635 Bug 1305217: Part 1 - Run webRequest listeners asynchronously. r=mixedpuppy
MozReview-Commit-ID: 2XF6irv5WBd
2016-11-12 13:51:59 -08:00
Sebastian Hengst
990d219d9a Backed out changeset 4efa832fc852 (bug 1305217) for frequent timeouts in test_ext_webrequest_upload.html. r=backout 2016-11-12 13:45:03 +01:00
Kris Maglione
7374699bc7 Bug 1305217: Part 1 - Run webRequest listeners asynchronously. r=mixedpuppy
MozReview-Commit-ID: 2XF6irv5WBd
2016-11-11 11:09:35 -08:00
Shane Caraveo
b2ca77fcab Bug 1273138 fix WebRequest for background pages, r=kmag
MozReview-Commit-ID: DEW9anMmKi2
2016-11-02 09:30:50 -07:00
Tomislav Jovanovic
32a487cd24 bug 1293355 - add fromCache to onResponseStarted details, r=kmag
MozReview-Commit-ID: GO0a8s8D2oT
2016-09-21 21:57:15 +02:00
Rob Wu
812e170fe8 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
2016-08-16 15:51:50 -07:00
Rob Wu
a68fdede92 Bug 1287010 - Use minimal global scope for ext-*.js scripts r=billm
Currently there is a tight coupling between registered APIs because they
share the same global scope, and the dependencies between the modules
that use these globals are not explicit. Consequently, it would be
possible for APIs to break when the registered APIs run in separate
processes, because then there are separate global scopes.
To mitigate this issue, this patch isolates the global namespaces of
API registrations in different environments, starting with the "chrome"
process. Content and addon processes will follow later.

A new JSM is introduced to avoid hidden dependencies between ext-*.js
and the script loader. ExtensionUtils.jsm would be a natural choice for
this shared utility method, but cannot be used because its local
`EventEmitter` implementation conflicts with the `EventEmitter` import
in ext-tabs.js.

So, this patch provides isolation of global variables declared through
`globals.XXX = ...`, but does not provide isolation for `Cu.import`-ed
logic. Ideally `Cu.import` should always use its second argument to
prevent inadvertent namespace pollution.

MozReview-Commit-ID: 1DTZaKOaeSE
2016-08-17 20:28:19 -07:00
Rob Wu
6efdd88867 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
2016-08-15 01:04:58 -07:00
Sebastian Hengst
c7a498ffbd 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
6189daa99f 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
2016-08-15 01:04:58 -07:00
Giorgio Maone
fe97eb7f75 Bug 1201979 - Support requestBody in onBeforeRequest. r=kmag
MozReview-Commit-ID: LAHKN5uZO0
2016-07-29 23:38:43 +02:00
Kris Maglione
843973aa31 Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS
2016-06-09 17:44:47 -07:00
Sebastian Hengst
d97f588f03 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
b2a33e3bf1 Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS
2016-06-09 17:44:47 -07:00
Giorgio Maone
ac57061154 Bug 1242871 - add an originUrl property to every webRequest event details object + tests (extended & fixed + nits). r=kmag
MozReview-Commit-ID: 6PeCwTeCuFs
2016-04-01 00:48:57 +02:00
Giorgio Maone
91221ae90d Bug 1252596 - Implement webRequest.onErrorOccurred. r=kmag
MozReview-Commit-ID: GFeFjKlsMAD
2016-03-07 09:35:24 +01:00
Giorgio Maone
25af910545 Bug 1253924 - Implement statusLine + fix & test statusCode r=kmag
MozReview-Commit-ID: BhyM10w8iGt
2016-03-06 16:59:07 +01:00
Giorgio Maone
b21e727227 Bug 1163862 - Switch to HTTP observer + support requestId & data: URIs + test fixes r=billm
MozReview-Commit-ID: 30nEXQpWEHg
2016-02-26 19:08:32 +01:00
Phil Ringnalda
d4818c82ca Back out 8ae0fba61023 (bug 1163862) for Win7 e10s test_ext_webrequest.html bustage 2016-02-25 20:41:40 -08:00
Giorgio Maone
a690c97982 Bug 1163862 - Switch to HTTP observer where possible + support requestId & data: URIs r=billm
MozReview-Commit-ID: EBRWBgGPqyD
2016-02-24 00:21:42 +01:00
Kris Maglione
666cee3637 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
Andrew Swan
0f169f0772 Bug 1236940 - Add ip property to chrome.webRequest.onCompleted callback. r=billm 2016-02-02 21:08:51 -08:00
Bill McCloskey
771643dd4e Bug 1215197: Implements onBeforeRedirect by using a channel event sink (r=billm) 2015-12-30 13:34:45 -08:00
Bill McCloskey
3814f48c83 Bug 1208257 - [webext] web_request.json (r=kmag) 2015-12-06 08:50:24 -08:00
Kris Maglione
956fe582d0 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.
2015-12-02 16:58:53 -08:00
Bill McCloskey
3478126728 Bug 1223585 - [webext] Add some ignoreEvent calls (r=kmag) 2015-11-12 08:19:45 -08:00
Bill McCloskey
b13e53c118 Bug 1212718 - [webext] Add resource types for webRequest (r=Mossop) 2015-10-12 20:04:00 -07:00
Carsten "Tomcat" Book
036e6d2fa3 Backed out 2 changesets (bug 1202902) to recking bug 1202902 to be able to reopen inbound on a CLOSED TREE
Backed out changeset 647025383676 (bug 1202902)
Backed out changeset d70c7fe532c6 (bug 1202902)
2015-10-07 14:03:21 +02:00
Carsten "Tomcat" Book
12369728f5 Backed out 1 changesets (bug 1202902) for causing merge conflicts to mozilla-central
Backed out changeset cfc1820361f5 (bug 1202902)
2015-10-07 12:13:45 +02:00
Shu-yu Guo
474f49adb7 Bug 1202902 - Scripted fix the world. 2015-10-06 14:00:31 -07:00
Bill McCloskey
9b6ceea392 Bug 1202478 - [webext] Run WebExtension callbacks asynchronously (r=gabor) 2015-09-23 17:18:29 -07:00