Commit graph

108 commits

Author SHA1 Message Date
Rob Wu
72ac7d1f12 Bug 1287010 - Use schema-generated extension, split ext-extension.js r=billm
- This was the last non-schema-generated API in content scripts.

MozReview-Commit-ID: FaIOCHoircf

--HG--
extra : rebase_source : 7bab2249a7462a581e493f7aa937df45cb895107
2016-08-18 19:19:40 -07:00
Rob Wu
cf5257b11d Bug 1287010, 1286712 - Use schema-generated runtime API, split ext-runtime.js r=billm
- Use schema-generated runtime API for content scripts instead of
  untyped API.
- Move logic that cannot be run in the main process to a new file.

Together with the previous patch that migrated the i18n API, this
concludes the fix for bug 1286712.

MozReview-Commit-ID: A3yG0x1kjwx

--HG--
extra : rebase_source : 19efe95149c423c0f9284bb70e289a282fb758c1
2016-08-18 18:15:37 -07:00
Rob Wu
289e3b1ea7 Bug 1287010 - Use schema-generated i18n for all contexts r=billm
Use schema-generated i18n API for both content script and
addon contexts, instead of just the addon context.

MozReview-Commit-ID: AKDAFxNv6Zs

--HG--
extra : rebase_source : ea66e8bab7b4713d971614ce27e8c1d9350a0a14
2016-08-20 15:49:20 -07:00
Rob Wu
8053e5a9c0 Bug 1287010 - Prepare for moving content script APIs to schemas r=billm
- By default, schema APIs are not injected in content scripts unless
  the JSON schema sets the "restrictions" attribute to `["content"]`.
- Added the "restrictions" attribute to the storage and test schemas.
  Other APIs will follow in subsequent commits and make use of the
  primitives introduced in this commit.

MozReview-Commit-ID: 1rNjQap0BiM

--HG--
extra : rebase_source : bf2c7fb70a38fbf13cdfd4337cb3cb6fef7e67e8
2016-08-18 17:46:57 -07:00
Rob Wu
b21d936ca3 Bug 1287010 - Move Management logic to SchemaAPIManager r=billm
- Moved Management logic to ExtensionUtils (as SchemaAPIManager) so that
  the logic can be used by addon and content processes.
- Remove the `context.extension.hasPermission(api.permission)` check in
  `generateAPIs` because the only user (`registeredPrivilegedAPI`) was
  removed before in bug 1295082.
- Add new category "webextension-scripts-content", intended for
  registering the few scripts that must be loaded in a content process.

MozReview-Commit-ID: 81nhblV8YE6

--HG--
extra : rebase_source : d2eee0298ad5038225ea56c2e752532af0bc6fb7
2016-08-17 17:51:21 -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
Rob Wu
3451c2f756 Bug 1295082 - BaseContext.extensionId -> BaseContext.extension.id r=kmag
MozReview-Commit-ID: 2tFVUwjyJQu

--HG--
extra : rebase_source : 07ea6252ab49d992ff17db77dea5840732f478c4
2016-08-16 14:29:52 -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
Sebastian Hengst
3b39ae834c Backed out changeset dc7b09331202 (bug 1295082) 2016-08-18 16:46:30 +02:00
Rob Wu
62ec179344 Bug 1295082 - BaseContext.extensionId -> BaseContext.extension.id r=kmag
MozReview-Commit-ID: 2tFVUwjyJQu

--HG--
extra : rebase_source : 7091f5f8f52b158912fb503626a20d82db2142f8
2016-08-16 14:29:52 -07: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
Rob Wu
65acb9a681 Bug 1290157 - Always pass an array to tabs.executeScript on success r=kmag
MozReview-Commit-ID: Ctw8RUtfEZC

--HG--
extra : rebase_source : 7f76c1c99b5948463e5bfa0f7270fe50f6e95a88
2016-08-09 00:28:47 -07:00
Wes Kocher
e9097643d5 Merge inbound to central, a=merge 2016-08-12 13:44:29 -07:00
Kris Maglione
026f92fc96 Bug 1292369: Null out contentWindow properties when they point to a different inner window than the context belongs to. r=billm
MozReview-Commit-ID: LYQRxpU9vI8

--HG--
extra : rebase_source : 88aa9e5eb14d22696126c26f960edbc40e923b89
extra : histedit_source : 01ff56be73b884fe73f4543b875acf37a1469b3d
2016-08-04 16:18:25 -07:00
Kris Maglione
d16036cec9 Bug 1293700: Make console object available to WebExtension internals. r=aswan
MozReview-Commit-ID: GyD4uo95gt6

--HG--
extra : rebase_source : a1bb70bbc186c76d5c0437530662b0754516ea7b
extra : histedit_source : d8bf619ce3d39987b2850223ccb3f28a82cbc532
2016-08-09 12:40:25 -07:00
Rob Wu
38597ef1d7 Bug 1293126 - Remove Schemas.load from content's ExtensionContext r=kmag
MozReview-Commit-ID: JOToEC2Aokp

--HG--
extra : rebase_source : 23c867bf9f5bc4de4261e7d2ab3717557ba79bee
2016-08-07 17:59:58 -07:00
Rob Wu
9069fff35f Bug 1197451 - Add clipboardWrite permission r=billm
MozReview-Commit-ID: 6d1mQSVWRPe

--HG--
extra : rebase_source : 2f19bab5c9d6db25c60b2b19c06c7027384a04ca
2016-07-08 17:19:17 -07:00
Jared Wein
871ed4e3ba Bug 1291855 - Enable the no-else-return rule for eslint. r=Felipe,kmag,mossop
MozReview-Commit-ID: DYOmE6xwMJh

--HG--
extra : rebase_source : bc81b68ea5599fd1815dc34dac7106eef7044483
2016-08-03 18:54:59 -04:00
Kris Maglione
cd2ef08297 Bug 1274871: Return a more useful error message for executeScript without matching window. r=aswan
MozReview-Commit-ID: 3AhuxY6gQPL

--HG--
extra : rebase_source : 35323eefade3ebd254cfe5bcf0f21ce0cc26ffdb
extra : amend_source : 93e150dce3dd0f467d38b630cd517452c12683a8
2016-07-26 17:55:58 -07:00
Rob Wu
5d91567c97 Bug 1280482 - Add export helpers to content scripts. r=kmag
MozReview-Commit-ID: I4o3NXVphJX

--HG--
extra : transplant_source : P%B0k%A3%E6%ADz%ACE%BF%2B%5C%B0%9C%E8k%A3%DF%D6%C8
2016-07-15 23:33:47 -07:00
Kris Maglione
5421efdfa0 Bug 1284020: Treat window.fetch/window.XMLHttpRequest the same as the global variants in content scripts. r=aswan
MozReview-Commit-ID: Cuz6CiNZdrd

--HG--
extra : source : 56d636b5d961f3accab65064e7f81be1f78ad81e
extra : amend_source : cdf3359ed7c3e77ba21c942d2fc0280c8146648a
2016-07-12 15:45:07 -07:00
Sebastian Hengst
cf84fed281 Backed out changeset 56d636b5d961 (bug 1284020) for failures in browser_dbg_sources-webext-contentscript.js. r=backout 2016-07-13 10:02:09 +02:00
Kris Maglione
39215dfbd6 Bug 1284020: Treat window.fetch/window.XMLHttpRequest the same as the global variants in content scripts. r=aswan
MozReview-Commit-ID: Cuz6CiNZdrd

--HG--
extra : rebase_source : 03a70ab9a3d51cfac07d0f752a68c2f743abbc4c
2016-07-12 15:45:07 -07:00
Kris Maglione
005248648e Bug 1284942: Don't fire message listeners for windows hidden in bfcache. r=aswan
MozReview-Commit-ID: KSqLt7Qqdkf

--HG--
extra : rebase_source : 0b1322a7a4b6db5992bbe1cfc73975e2ed64035e
2016-07-06 17:14:02 -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
54c22ba9e3 Bug 1269141: Remove content script CSS when disabling an extension. r=aswan
MozReview-Commit-ID: Jhg4XzddIkA

--HG--
extra : rebase_source : 76376b369739cbba218cb7741b09ae040dafb6b4
extra : amend_source : 036a99c79100e4c3dca9076f28b93a42e0d15ac9
2016-06-04 21:42:55 -07:00
Kris Maglione
e5c33247eb Bug 1256607: Support cross-origin fetch() access in WebExtension content scripts. r=aswan
MozReview-Commit-ID: Aw1LSMY3BAW

--HG--
extra : rebase_source : 46b8e7cab96f248204801d2b96e64d8cdd1779ed
2016-06-04 20:31:13 -07:00
Bob Silverberg
1a2e1cbc77 Bug 1276338 - chrome.runtime.id is undefined in content scripts, r=kmag
MozReview-Commit-ID: BXqB1rW9DzB

--HG--
extra : transplant_source : %A1%94%B0%E9%19%B6%BC%04%84dd%EA%E9%9B%80%CD%FD%83%D5%B3
2016-05-31 11:55:30 -04:00
Claas Augner
3c65a4e758 Bug 1247455 - Add a .removeCSS method to complement .insertCSS. r=kmag 2016-04-15 00:39:09 +02:00
Bill McCloskey
261372f2cb Bug 1197346 - Allow browser.storage to be used from content scripts (r=kmag) 2016-04-23 20:04:30 -07:00
Luca Greco
7eb008c009 Bug 1261857 - [webext] Support WebExtensions ContentScripts in the Tab DevTools Debugger. r=kmag
MozReview-Commit-ID: BtGqvAkRJZx

--HG--
extra : transplant_source : %FF%82%A5%3B%AE%9Ck%0C%07%B6%224%93%B9%F1%995%DF%A1.
2016-04-15 17:09:57 +02:00
Dave Townsend
b6c94f538f Bug 1257246: Update webextension APIs for eslint 2. r=kmag
ESLint 2 now flags anonymous generator functions that don't match the
generator-star-spacing rule so this mostly is fixing that.

MozReview-Commit-ID: 5sLaF26sd0E

--HG--
extra : rebase_source : 6008f48c94e4a8e5bd2ed2f8a95e764e4aa39cdb
extra : histedit_source : 6f0151c184ee2e4288f3ec9c5a85a65e975d46e1
2016-04-05 11:30:51 -07:00
Wes Kocher
51eb5dbf5a Merge inbound to central, a=merge
MozReview-Commit-ID: L8YZYtbmper
2016-04-07 13:42:10 -07:00
Andrew Swan
4887be777d Bug 1217944 - Part 2 - Support wildcards in web_accessible_resources r=kmag
MozReview-Commit-ID: Ln6JJ5lxc3w

--HG--
extra : transplant_source : T%08%A4%E32%01%A9%91%25X%95%14dU%1B%BDd%D97%85
2016-04-06 13:20:23 -07:00
Andrew Swan
8aa15a9f8c Bug 1217944 - Part 1 - Make MatchGlobs work on arbitrary strings r=kmag
MozReview-Commit-ID: CK39lpGglKA

--HG--
extra : transplant_source : m%0C%D4%E0W%00%0F%00%D05%1E%8D%D8%91%C2%218nFB
2016-04-06 13:07:47 -07:00
Kris Maglione
bb87bbc539 Bug 1258199: [webext] Return an empty string for missing keys in getMessage. r=aswan
MozReview-Commit-ID: KEQYq4nZbfk

--HG--
extra : source : c67309c62021bf173fc981634de54bc8e9c992ee
extra : histedit_source : d0449a21df83e392455466b7e7dac4e0521b5d50%2C3aec582f8a1389ae8b90efa76259d6df5269fd0d
2016-04-04 13:54:27 -07:00
Wes Kocher
912fe2afbf Backed out changeset c67309c62021 (bug 1258199) for xpcshell failures
MozReview-Commit-ID: FySkZPotDGU
2016-04-04 13:51:12 -07:00
Kris Maglione
11af2dd528 Bug 1258199: [webext] Return an empty string for missing keys in getMessage. r=aswan
MozReview-Commit-ID: KEQYq4nZbfk

--HG--
extra : rebase_source : d881f8a78b0c8081ed80e18477cc000017ab73b6
2016-03-28 17:21:06 +02:00
Tom Schuster
3f7b262a15 Bug 1223634 - Support exclude_globs/include_globs in webext manifests. r=kmag
--HG--
extra : rebase_source : e6a951c77581b08fa8613852f54665506e9fb0ba
2016-03-16 15:11:57 +01:00
Kris Maglione
876d0a0806 Bug 1220154, 1249830: Handle sendMessage replies with 0 and >1 listeners correctly. r=billm
MozReview-Commit-ID: 7lE7RaJcl7n

--HG--
extra : rebase_source : 424987c745840d56647600b8d9e1bf941afb1d95
2016-03-04 15:40:56 -08:00
Dave Huseby
c01e63f1a5 Bug 1238177 - fix extension content needs to use the correct user context id origin attribute. r=sicking
(HEAD -> oa, refs/patches/oa/Bug_1238177)
Fixes Bug 1238177 -- extension content needs to use the correct user context id origin attribute
2016-04-04 12:20:00 +02:00
Kris Maglione
66f9b57852 Bug 1248499: [webext] Implement tabs.detectLanguage. r=billm
MozReview-Commit-ID: F4GpSesj2ho

--HG--
extra : rebase_source : e9ffab3396b4f813c60e366c371ea54baccc160a
2016-02-26 13:20:28 -08:00
Kris Maglione
a3d6e11dea Bug 1248497 – Add promise support to the sendMessage APIs. r=billm
MozReview-Commit-ID: AZH9LUq8kGr

--HG--
extra : rebase_source : 2bf4d05544e6c22cb22de5b97fc523c477813ca3
2016-02-15 17:37:19 -08:00
Kris Maglione
2eda01945e Bug 1213993: [webext] Support frameId/allFrames/runAt in browser.tabs.executeScript and insertCSS. r=billm
MozReview-Commit-ID: FgV9vyHVjj8

--HG--
extra : rebase_source : 04582c711ef40f3afc7eeaa9e4dec2e31b63e4e0
2016-02-08 17:40:02 -08:00
bsilverberg
ad65868512 Bug 1213450 - Complete the implementation of chrome.i18n - getAcceptLanguages, r=kmag
Implement browser.i18n.getAcceptLanguages() including tests
Rebase against fx-team, resolving some conflicts
Fix eslint errors/warnings

MozReview-Commit-ID: 52sZWsIHbl4

--HG--
extra : amend_source : 2339e42a83460682a8d6df206c10849b38a288eb
2016-02-25 07:29:09 -05:00
bsilverberg
c244ff7396 Bug 1246754 - Complete the implementation of chrome.i18n.detectLanguage, r=kmag
MozReview-Commit-ID: 7cvJj0QP5XO

--HG--
extra : rebase_source : 47b4a7bfdbae2ed0981508fa6854417015d8ceed
2016-02-23 22:01:11 -05:00
Phil Ringnalda
8c87e2d3d9 Back out 9466f6513f50 (bug 1213450) for timeouts in test_ext_i18n.html 2016-02-23 18:36:11 -08:00