Commit graph

55 commits

Author SHA1 Message Date
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
e9d8b48ce4 Bug 1259093: Part 3 - Preload browserAction popups to prevent flicker during opening. r=Gijs r=jaws r=bwinton f=mattw
MozReview-Commit-ID: EpAKLV8VPTn

--HG--
extra : rebase_source : 6ce6e622734214c7214fc2ddb7ddb2233fc0c8fd
2016-08-19 12:29:11 -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
Kris Maglione
4f1b1dda0b Bug 1225215: [webext] Raise the expected errors when given invalid tab IDs. r=aswan
MozReview-Commit-ID: E5G0GmVhzLh

--HG--
extra : rebase_source : 5c6624b9d2d06109a1b047ad48dcac7e9405ee59
extra : amend_source : fb23020f7d2772f56fabc61f2e32f7d9c4c2f52a
2016-02-26 17:56:30 -08:00
Kris Maglione
0dba25a0da Bug 1288979: Always convert badge background color to a ColorTuple. r=aswan
MozReview-Commit-ID: CWmaa9wwQLD

--HG--
extra : rebase_source : aa8eaa19bad2b825c818abd29172f75fa84368dd
2016-08-04 14:50:52 -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
Pushpankar
c6670d980f Bug 1286854 - Replace ownerDocument.defaultView with ownerGlobal in browser/. r=dao
--HG--
extra : rebase_source : 72d50e73baf595840a2aade57ae782e4c40d4c27
2016-07-16 10:20:04 +02:00
Kris Maglione
63c5aef93a Bug 1272222: Use larger icons for browser actions in the menu panel. r=Gijs
MozReview-Commit-ID: 26lmlcrngPk

--HG--
extra : rebase_source : b9d6bfb7669d3cb826ccaa6728e153ad3e3b2b8b
2016-07-13 15:16:00 -07:00
Matthew Wein
569e667c08 Bug 1270742 - Add support for default_icon in chrome.pageAction r=kmag
MozReview-Commit-ID: D9uR0JUXJwx

--HG--
extra : transplant_source : %FC%FBu%0Cboh%DFv%BB%8D%AC%20%ED%A5%E1%3E%DE%126
2016-05-23 15:59:33 -07:00
Kris Maglione
c80375c0f9 Bug 1272219: Use 16px icons for BrowserAction buttons, support 18px as a legacy fallback. r=bwinton ui-r=bwinton
MozReview-Commit-ID: 2c0UWR6hITQ

--HG--
extra : rebase_source : 5dd417ba99bb85a50dd1ae87cf2fb5603da07ce8
2016-06-05 21:05:36 -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
Blake Winton
6866a9d937 Bug 1269081 - Only apply Firefox's default styles if the add-on author sets "browser_style" to true in the manifest. r=kmag.
MozReview-Commit-ID: JjH0sCkh1U7

--HG--
extra : rebase_source : 92b126d4acd77bb15bb7c952b82d4dd6156d5c2a
2016-05-02 10:59:36 -04:00
Matthew Wein
863d9f6ce1 Bug 1246035 - Add support for _execute_page_action r=kmag
MozReview-Commit-ID: LPQAC7uJTkr
2016-03-14 14:54:57 +01:00
Sebastian Hengst
53b1ca7a7f Backed out changeset 4a92742ac20d and ddf8219182fb (bug 1246035) for failing modified ddf8219182fb on OS X 10.6 opt M(bc2). r=backout 2016-03-25 23:14:25 +01:00
Matthew Wein
6bfb9ef781 Bug 1246035 - Add support for _execute_page_action. r=kmag
MozReview-Commit-ID: LPQAC7uJTkr

--HG--
extra : transplant_source : %9Fc%B4C%C75Nd%40.%EBj%25%8Cg%5B%B3%C0%E5F
2016-03-14 14:54:57 +01:00
Carsten "Tomcat" Book
df65ba1904 Backed out changeset 70960616621c (bug 1246035) for eslint failures
--HG--
extra : rebase_source : 1aabe3c342278594617826d065640425eb557b19
2016-03-18 10:04:15 +01:00
Matthew Wein
8b0e3b8eb2 Bug 1246035 - Add support for _execute_page_action. r=kmag
MozReview-Commit-ID: LPQAC7uJTkr

--HG--
extra : transplant_source : %85%1C%3D%2B%EF%E7%02ya%21/ad%A3%A4R%E9%13%0C%13
2016-03-14 14:54:57 +01: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
a2027208b5 Bug 1234020: Part 2g - [webext] Return promises from the browserAction API. r=rpl
--HG--
extra : commitid : GQvpkew9gD
extra : rebase_source : ec53fa009edc8c874895f2f1abf8d896c5dd6753
2016-02-01 18:14:05 -08:00
Kris Maglione
59c0ce29a5 Bug 1217129: Part 5 - [webext] Use CustomizableUI views for BrowserAction popups. r=gijs ui-r=bwinton
This version addresses some popup sizing bugs, and also a few other issues I
ran into when debugging Blake's problems:

 * The standalone popup needs a max width of 800px for Chrome compatibility,
   which is wider than our default max width.

 * I added a flex attribute to our browser so that it fills the entire space
   of the slide-in panel. This is only necessary for browsers with content
   that is shorter than the height of the panel when it gets its desired
   width, but becomes longer when it doesn't, so it didn't show up in my
   initial tests.

 * I also added an extra pixel to the width calculations, since I noticed that
   a lot of single lines of text were unexpectedly wrapping without it. I'll
   look into this more in a follow-up bug.

I also added some comments, and renamed a couple of variables, where things
seemed unclear.

The test changes are mostly just updates to older browser action tests to use
newer helpers, rather than ad-hoc events, to open/close/click the widgets. A
few tests also needed updates to explicitly close the panel when they were
done with it.

--HG--
extra : commitid : BhHv1aZSrBL
extra : rebase_source : 6fe0069ebd2f94b0ffd02ad757a799fbdff9226e
extra : source : 628af985c7eba7e4665a1b62f9a60f6a6fd39822
2016-01-15 15:14:25 -08:00
Kris Maglione
3284cbb0ee Bug 1217129: Part 4b - [webext] Use the extension name as the default title value for browserAction/pageAction popups. r=billm
This brings our behavior closer in line with Chrome's.

--HG--
extra : commitid : DaDofvmQEZW
extra : rebase_source : cbeda3889362511c5002f2710c063a2c83047d3c
extra : source : 7ad8b56958c54787313ecbe60eb1e8fbafb2f376
2016-01-15 21:43:26 -08:00
Carsten "Tomcat" Book
cc15740ff7 Backed out 8 changesets (bug 1217129) for test failures in browser_ext_pageAction_context.js
Backed out changeset dc5742de0823 (bug 1217129)
Backed out changeset 106365a3847c (bug 1217129)
Backed out changeset 628af985c7eb (bug 1217129)
Backed out changeset 7ad8b56958c5 (bug 1217129)
Backed out changeset 71f46fe62f59 (bug 1217129)
Backed out changeset 7d8dee4c335b (bug 1217129)
Backed out changeset 3b5fb2845c3b (bug 1217129)
Backed out changeset 93266f211716 (bug 1217129)
2016-01-18 09:08:35 +01:00
Kris Maglione
afba49d5ab Bug 1217129: Part 5 - [webext] Use CustomizableUI views for BrowserAction popups. r=gijs ui-r=bwinton
This version addresses some popup sizing bugs, and also a few other issues I
ran into when debugging Blake's problems:

 * The standalone popup needs a max width of 800px for Chrome compatibility,
   which is wider than our default max width.

 * I added a flex attribute to our browser so that it fills the entire space
   of the slide-in panel. This is only necessary for browsers with content
   that is shorter than the height of the panel when it gets its desired
   width, but becomes longer when it doesn't, so it didn't show up in my
   initial tests.

 * I also added an extra pixel to the width calculations, since I noticed that
   a lot of single lines of text were unexpectedly wrapping without it. I'll
   look into this more in a follow-up bug.

I also added some comments, and renamed a couple of variables, where things
seemed unclear.

The test changes are mostly just updates to older browser action tests to use
newer helpers, rather than ad-hoc events, to open/close/click the widgets. A
few tests also needed updates to explicitly close the panel when they were
done with it.

--HG--
extra : commitid : 9OyRnaMTqn8
extra : rebase_source : efd28a49ca5961e2cf545420a81bd19b796d8957
2016-01-15 15:14:25 -08:00
Kris Maglione
5c12caa1dc Bug 1217129: Part 4b - [webext] Use the extension name as the default title value for browserAction/pageAction popups. r=billm
This brings our behavior closer in line with Chrome's.

--HG--
extra : commitid : 7X5knx0CtGm
extra : rebase_source : b301e9c568df0edb313b10cf06e2f7a9c23a6e78
2016-01-10 21:00:09 -08:00
Bill McCloskey
a3d3a41850 Bug 1208257 - [webext] browser_action.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
66c9592a32 Bug 1190688: Part 1 - [webext] Implement the activeTab permission. r=billm
--HG--
extra : commitid : 7CvbJtxVmuS
extra : rebase_source : 88dadc60ac17cd9036f85c81ac19dfb3db1d0c91
extra : source : 4a10c564dfca3189ab521c3ccfa92330163189b1
2015-12-01 20:37:41 -08:00
Wes Kocher
fdc2d1bcff Backed out 2 changesets (bug 1190688) for browser_ext_tabs_executeScript.js permatimeouts
Backed out changeset 1d5e9f3d094d (bug 1190688)
Backed out changeset 4a10c564dfca (bug 1190688)
2015-12-02 11:22:31 -08:00
Kris Maglione
de25656504 Bug 1190688: Part 1 - [webext] Implement the activeTab permission. r=billm
--HG--
extra : commitid : 3fCvT7O5Oax
extra : rebase_source : 6df43947daa552eb318bf74a3c71792889328618
2015-12-01 20:37:41 -08:00
Kris Maglione
e716dce577 Bug 1213433: [webext] Add enable and disable methods to browserAction API. r=gabor
--HG--
extra : commitid : IxCwe5mcCex
extra : rebase_source : 36e405fc199890175b70c9228c8beeafa665d667
extra : histedit_source : 21d800886ddf31425ea691c77558f987590df8ad
2015-10-28 02:27:29 -07:00
Bill McCloskey
fd0aea8d56 Bug 1223585 - [webext] Annotate ignoreEvent (r=kmag) 2015-11-12 08:19:45 -08:00
J. Ryan Stinnett
986f2a5cde Bug 1203159 - Rewrite DevTools resource URLs. r=ochameau 2015-10-21 12:48:53 -05:00
Kris Maglione
afa8d67bb4 Bug 1197422 - Part 3: [webext] Update browserAction API to use the same context tracking code as pageAction. r=billm
--HG--
rename : browser/components/extensions/test/browser/browser_ext_pageAction_context.js => browser/components/extensions/test/browser/browser_ext_browserAction_context.js
extra : commitid : 5EzvwcupwbG
extra : rebase_source : 5ac2d9c8d131c718bd3290120a8b108e4601c36f
2015-10-15 15:14:49 -07:00
Kris Maglione
9dd208611e Bug 1197422 - Part 2: [webext] Implement the pageAction API. r=billm ui-r=bwinton
--HG--
rename : browser/components/extensions/test/browser/browser_ext_browserAction_icon.js => browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js
extra : commitid : GSQiN6Zykrs
extra : rebase_source : 45e056feb97f60592400568c6eeded4b7cc76ab5
2015-10-15 15:15:04 -07:00
Carsten "Tomcat" Book
08997000eb 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
e7ef778c9d Backed out 1 changesets (bug 1202902) for causing merge conflicts to mozilla-central
Backed out changeset cfc1820361f5 (bug 1202902)

--HG--
extra : rebase_source : 5d3db72337754bc7ab0ed0c30b2896100411ff92
2015-10-07 12:13:45 +02:00
Shu-yu Guo
d06b6030f6 Bug 1202902 - Scripted fix the world. 2015-10-06 14:00:31 -07:00
Bill McCloskey
dd18632ad0 Bug 1202483 - [webext] Support ImageData for browser.browserAction.setIcon (r=gabor) 2015-09-23 17:18:32 -07:00
Bill McCloskey
d8c4e2691e Bug 1190662 - [webext] Browser action popup HTML should be reloaded each time popup is opened (r=gabor) 2015-09-23 17:18:26 -07:00
Phil Ringnalda
5b1ea9212a Backed out 12 changesets (bug 1202482, bug 1202483, bug 1202481, bug 1202486, bug 1202479, bug 1202478, bug 1197475, bug 1203331, bug 1139860, bug 1202501, bug 1199473, bug 1190662) for Mulet mochitest-5 timeouts
CLOSED TREE

Backed out changeset 6503123e95dd (bug 1139860)
Backed out changeset b83bc163064d (bug 1203331)
Backed out changeset 2f501bd57cd2 (bug 1202481)
Backed out changeset 37e6ac7beb42 (bug 1202486)
Backed out changeset f9b6e99e620e (bug 1202483)
Backed out changeset 466af9f9baee (bug 1202482)
Backed out changeset 6be690e265a2 (bug 1202479)
Backed out changeset 57ff88bfccf4 (bug 1197475)
Backed out changeset 7e8c04ff6049 (bug 1202478)
Backed out changeset 525227997274 (bug 1202501)
Backed out changeset da317cdb79d3 (bug 1199473)
Backed out changeset 73b8ddd6dac9 (bug 1190662)

--HG--
rename : browser/components/extensions/test/browser/browser_ext_simple.js => browser/components/extensions/test/browser/browser_extensions_simple.js
rename : toolkit/components/extensions/test/mochitest/file_sample.html => toolkit/components/extensions/test/mochitest/file_contentscript_page1.html
2015-09-22 19:29:51 -07:00
Bill McCloskey
095d27b08a Bug 1202483 - [webext] Support ImageData for browser.browserAction.setIcon (r=gabor) 2015-09-22 16:09:22 -07:00
Bill McCloskey
68b72b8a50 Bug 1190662 - [webext] Browser action popup HTML should be reloaded each time popup is opened (r=gabor) 2015-09-22 16:09:20 -07:00
J. Ryan Stinnett
efe328f1b2 Bug 912121 - Rewrite require / import to match source tree. rs=devtools
In a following patch, all DevTools moz.build files will use DevToolsModules to
install JS modules at a path that corresponds directly to their source tree
location.  Here we rewrite all require and import calls to match the new
location that these files are installed to.

--HG--
extra : commitid : F2ItGm8ptRz
extra : rebase_source : b082fe4bf77e22e297e303fc601165ceff1c4cbc
2015-09-21 12:04:18 -05: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
Bill McCloskey
06a195312a Bug 1199842 - [webext] Add missing XUL_NS variable for browser_action (r=gabor) 2015-09-04 09:45:02 -07:00