Commit graph

40 commits

Author SHA1 Message Date
djmdev
f08897dbcb Bug 1274860 - Modify getContexts function so that page context is applied properly. r=kmag
--HG--
extra : rebase_source : 62f9766eafa3a8a1e3b0b1f3bc95c22904ec6047
2016-11-11 17:49:44 +05:30
Kris Maglione
aa7573eedb Bug 1315872: Refactor tests that check for promise rejection to use assertRejects. r=aswan
MozReview-Commit-ID: 1fBE7B2OdH7

--HG--
extra : rebase_source : bd9e12c0ef3f0735e7587fe5db19cc10cd5a47e5
extra : histedit_source : aa50834f1c2594e28eae83fded023df284d3d3c0
2016-11-07 22:04:49 -08:00
Rob Wu
0c66504d77 Bug 1287007 - Fix "onclick" in contextMenus, to child. r=billm
Main thing: Making contextMenus implementation webext-oop compatible.

Preparation:

- Add getParentEvent to ChildAPIManager to allow use of remote events.
- Introduce `addon_parent_only` to "allowedContexts" to only generate a
  schema API in the main process.
- Do not fill in `null` for missing keys if the schema declares a key as
  `"optional": "omit-key-if-missing"`. This is needed for the second
  point in the next list.

Drive-by fixes:

- Ensure that the "onclick" handler is erased when a context closes.
- Do not clear the "onclick" handler in `contextMenus.update` if the
  onclick key has been omitted (parity with Chrome).
- Remove some unnecessary `Promise.resolve()`
- Add extensive set of tests that check the behavior of the contextMenus
  APIs with regards to the onclick attribute in various scenarios.

MozReview-Commit-ID: A5f3AUQzU8T

--HG--
extra : rebase_source : 0464a1aa2387343a6f1d0fcd8fbabfdd1a68b1bb
2016-09-12 18:26:03 -07:00
Tomislav Jovanovic
6c44e70416 bug 1274809 - Add missing properties to OnClicked data, r=aswan
MozReview-Commit-ID: 4BodpIuKCz2

--HG--
extra : rebase_source : 981fe298e821c872898f503707ccd59fcb85b869
2016-09-21 02:12:11 +02: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
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
Rob Wu
ed596b32d9 Bug 1275126 - Implement targetUrlPattern for link contexts. r=kmag
MozReview-Commit-ID: EzqX8YbeQqI

--HG--
extra : transplant_source : %11%87%12%B3%C5a%C5%93c%05%16%04%D9g%D9%CD%B6%8AH%7B
2016-07-27 18:23:24 -07:00
Matthew Wein
7ea866f07e Bug 1275116 - Fix {document|target}UrlPatterns by passing in the correct arguments to SingleMatchPattern.match. r=kmag
MozReview-Commit-ID: LLNu7jNfUZq


G: changed browser/components/extensions/test/browser/head.js

--HG--
extra : transplant_source : %88%06%94%11%B5l%3B%9F%26%9CjGL%A3%F3%11%7F%40%D4Q
2016-07-14 14:41:03 -07: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
930e6de010 Bug 1246044 - Part 2 - Fix issue where context menu items show up after extension is uninstalled. r=kmag
MozReview-Commit-ID: 9eGwSkY8PWo

--HG--
extra : rebase_source : 378af343cc7eb5363b90532ab423fe11e0d0a535
2016-07-05 17:11:21 -07:00
Matthew Wein
8b6e105036 Bug 1284265 - Fix regression caused by bug 1270742 which moved IconDetails into ExtensionUtils.jsm r=kmag
Postmortem: The context menu script, ext-contextMenus.js, uses IconDetails to show the extension icon next to the top level menu item. Originally, IconDetails lived in ext-utils.js because it was only used by Desktop.  However, in order to make it usable by Fennec for the PageActions API, it was moved into the shared ExtensionUtils.jsm.  Since none of the unit tests for ext-contextMenus.js covered the use of IconDetails, when it was moved it broke this part of the code. Switching it to use the version in ExtensionUtils.jsm fixes the issue. Lesson learned: Don't leave anything untested.

MozReview-Commit-ID: I6bFQnKvoMh

--HG--
extra : transplant_source : %140%8As%BC%86%17%0A%FE%85%F2%97P%19i%D8%84%AD%87%ED
2016-07-05 16:17:52 -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
Bob Silverberg
632b11bf2f Bug 1274877 - contextMenus API starts logging errors after removing an item, r=kmag
MozReview-Commit-ID: 86bxjxEQaQX
2016-06-07 15:26:08 -04:00
jdinartejesus
d7b2387a81 Bug 1250685 - Fix extension context menu for images. r=kmag 2016-04-11 00:40:50 +02:00
Matthew Wein
e1cc040df8 Bug 1250631 - Implement chrome.contextMenus.onClicked. r=kmag
MozReview-Commit-ID: Ic7opjJtmRB

--HG--
extra : transplant_source : %BF%F9%92%ABd%AA%E6%A6%AA%26%2B%CA%C1%23%FCl%2B%03%D8%B5
2016-03-23 02:39:10 -07:00
Matthew Wein
94fc7c715c Bug 1215375 - Add support for checkboxes, radio groups, and icons. r=kmag 2016-03-02 15:10:01 -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
a3bb54ada2 Bug 1234020: Part 2i - [webext] Return promises from the contextMenus API. r=rpl
--HG--
extra : commitid : 2Ki745t8xRB
extra : rebase_source : 5fe21e317050f7b7109cd555cbbd05ed2e9883f5
2016-02-01 18:14:55 -08:00
Kris Maglione
cf89a22459 Bug 1211366: Follow-up: Fix ESLint errors. r=trivial
--HG--
extra : commitid : CkUBR1wpIeR
extra : rebase_source : 67d877bd2a379412b357f98227b8bc47fd068595
2016-01-05 14:10:58 -08:00
Gabor Krizsanits
f77ea57991 Bug 1235376 - Handling %s in contextMenus. r=kmaglione 2016-01-04 16:54:59 +01:00
Gabor Krizsanits
99d250bd13 Bug 1211366 - parentId validation in contextMenus. r=kmaglione 2016-01-04 16:54:59 +01:00
Gabor Krizsanits
c3b77c61e9 Bug 1211366 - contextMEnus refactoring. r=kmaglione 2016-01-04 16:54:59 +01:00
Bill McCloskey
a2c4e965e2 Bug 1208257 - [webext] context_menus.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
62d3c9701a Bug 1229874: Part 2 - Fix the major errors detected by ESLint. r=billm
--HG--
extra : commitid : 8MfFtdlzGEG
extra : rebase_source : 744d65868d5a3d217bd5f6428a3486e95fa14716
extra : source : 880fc261adae00a344e227ea2fa246b771cd57a6
2015-12-02 16:58:24 -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
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
Gabor Krizsanits
255204ccf7 Bug 1190667 - WEAPI contextMenus. r=billm 2015-10-05 17:48:08 +02:00
Bill McCloskey
b1a00d7c72 Bug 1175770 - New extension API (r=Mossop) 2015-08-03 10:41:24 -07:00
Carsten "Tomcat" Book
03d48d1951 Backed out changeset 4e3821b236f9 (bug 1175770) 2015-08-03 09:37:54 +02:00
Bill McCloskey
14e7d8ca0a Bug 1175770 - New extension API (r=Mossop) 2015-08-02 17:29:55 -07:00