Commit Graph

49 Commits

Author SHA1 Message Date
Bob Silverberg
b2a19417d4 Bug 1293853 - Part 3: Add support for separators to bookmarks API, r=mixedpuppy
This adds support for separators to the bookmarks API. Separators can now be created
and will be returned by any method that returns BookmarkTreeNodes. They will also be
included in data for the onCreated and onRemoved events.

BookmarkTreeNodes will now contain a `type` property which will be one of bookmark,
folder or separator. When creating a bookmark object, one can specify the type, or one
can rely on the Chrome-compatible behaviour which treats any bookmarks without a URL
as a folder. To create a separator one must specify a type as part of the CreateDetails
object.

MozReview-Commit-ID: BoyGgx8lMAZ
2017-08-28 17:05:55 -04:00
Kris Maglione
8077ebeb20 Bug 1387898: Remove unnecessary uses of EventEmitter.decorate. r=mixedpuppy
MozReview-Commit-ID: FRCdXHc3S4K
2017-08-07 14:42:57 -07:00
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
Bob Silverberg
fc23069408 Bug 1374237 - Part 1: Uniquify the name of the convert functions in ext-cookies.js and ext-bookmarks.js, r=mixedpuppy
Also declare all top-level functions in those files via const.

MozReview-Commit-ID: FsIEHVeotX8
2017-06-21 14:19:39 -04: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
Bob Silverberg
2addc83c48 Bug 1364546 - Set the children property for BookmarkTreeNodes without children, r=mixedpuppy
BookmarkTreeNodes without children do not contain a children property, but they should actually
contain a children property which is an empty array. This is what Chrome does as well.

This patch fixes that, and includes a test for a case of getChildren that was previously
untested, which I noticed when working on this code.

MozReview-Commit-ID: CjUwExma760
2017-05-23 15:16:10 -04:00
Kris Maglione
232ff61655 Bug 1365005: Cleanup async code after Task.jsm migration. r=aswan
MozReview-Commit-ID: FNKSsBqq6Kf
2017-05-15 12:07:06 -07:00
Florian Quèze
ff53eb9a63 Bug 1353542 - massive script-generated patch converting Task.async and Task.spawn calls, and generators clearly identifiable as tasks, rs=Mossop. 2017-05-12 14:42:39 +02: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
Florian Queze
d3c36892fa Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst
42670ceca0 Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
Florian Queze
9b4f73599f Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Kris Maglione
937291f42b Bug 1350522: Part 4 - Convert browser APIs to lazy loading. r=aswan
MozReview-Commit-ID: BQoWF9nHOuF
2017-04-02 11:59:55 -07:00
Jerry Krinock
0c4dcaae3a Bug 1343473 - Fixed parentId on the root node returned from bookmarks.getSubTree. r=bsilverberg, r=mixedpuppy 2017-03-16 15:43:00 -04: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
Tom Schuster
8a865b25f4 Bug 1221764 - Implement simple chrome.bookmarks events, r=aswan,mak
MozReview-Commit-ID: LWbhYf8CpZD
2016-08-17 10:22:10 -04: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
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
Andrew Swan
a2332fe11b Bug 1292605 Import PlacesUtils.jsm in ext-bookmarks r=kmag
MozReview-Commit-ID: 7h3SR5r9TWN
2016-08-04 13:47:36 -07:00
Jared Wein
ebf1ccbe46 Bug 1291855 - Enable the no-else-return rule for eslint. r=Felipe,kmag,mossop
MozReview-Commit-ID: DYOmE6xwMJh
2016-08-03 18:54:59 -04:00
Matthew Wein
e3d00b8074 Bug 1285063 - Part 2: Switch to using the Category Manager to register scripts/schemas in order to load them in time for Fennec. r=kmag
MozReview-Commit-ID: 2U8cTYeH8kg
2016-07-22 12:44:40 -07: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
Ryan VanderMeulen
75cbf81886 Merge inbound to m-c. a=merge 2016-03-12 15:23:38 -05:00
Kris Maglione
eba5c71ba8 Bug 1250784: Follow-up: Fix merge conflict in bookmarks API. r=me
MozReview-Commit-ID: 83I9WhoUZGj
2016-03-11 11:07:22 -08:00
Carsten "Tomcat" Book
5968960e97 Merge mozilla-central to fx-team 2016-03-11 16:58:46 +01:00
Kris Maglione
e1b59246c8 Bug 1250784: Part 2 - [webext] Fix some issues that cause noisy tests. r=Mossop
MozReview-Commit-ID: 93NMinJpWRo
2016-03-09 17:26:27 -08:00
bsilverberg
e065590115 Bug 1236121 - Complete test coverage for the WebExtension bookmarks API. r=kmag
Add coverage for getChildren() when the promise is rejected
Add coverage for create() specifying index
Add coverage for update() specifying a URL
Add coverage for update() when the promise is rejected

MozReview-Commit-ID: 7ANRDWRublL
2016-03-09 10:02:40 -05:00
bsilverberg
f42418db88 Bug 1252250 - Implement browser.bookmarks.removeTree(), r=kmag r=mak
MozReview-Commit-ID: HyjJrEjcsZu
2016-03-03 08:00:42 -05:00
Kit Cambridge
235c9a22f1 Back out changeset a67f0b208af6 (bug 1252250) for merge conflicts.
MozReview-Commit-ID: IQzGkqThQzG
2016-03-04 14:46:15 -08:00
bsilverberg
f29825215a Bug 1252250 - Implement browser.bookmarks.removeTree(), r=kmag r=mak
MozReview-Commit-ID: HyjJrEjcsZu
2016-03-04 11:02:28 -08:00
bsilverberg
39c7e3b3f2 Bug 1251269 - Implement browser.bookmarks.getRecent(), r=kmag r=mak
MozReview-Commit-ID: 7nYCplcQZuk
2016-03-03 08:07:16 -05:00
bsilverberg
e9d9dc6ce0 Bug 1253652 - Fix browser.bookmarks.move() and add tests for it. r=kmag, r=mak
Update Bookmarks.update to not require a parentGuid when updating just the index.

MozReview-Commit-ID: JJO2IDyI5oN
2016-03-09 09:30:43 -05: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
Johann Hofmann
5e98a1f54b Bug 1225743 - Implement chrome.bookmarks.search. r=mak 2015-11-24 17:40:08 +01:00
Carsten "Tomcat" Book
34453ebd37 Backed out changeset 9802a7367d48 (bug 1225743) for ES failures 2016-02-12 12:16:19 +01:00
Johann Hofmann
839767f308 Bug 1225743 - Implement chrome.bookmarks.search 2015-11-24 17:40:08 +01:00
Kris Maglione
3b9ea820cd Bug 1234020: Part 2f - [webext] Return promises from the bookmarks API. r=evilpie 2016-02-01 18:12:45 -08:00
Bill McCloskey
cc4c432b00 Bug 1208257 - [webext] bookmarks.json (r=kmag) 2015-12-23 08:57:13 -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
948f074381 Bug 1223585 - [webext] Annotate ignoreEvent (r=kmag) 2015-11-12 08:19:45 -08:00
Fabrice Desré
0c7dd07bd3 Bug 1214021 - Move ext-bookmarks to browser/ r=billm 2015-10-14 16:31:08 -07:00