Commit Graph

67 Commits

Author SHA1 Message Date
Kris Maglione
c8ea1d4273 Bug 1421459: Update to ESLint 4 "indent" rule. r=aswan
MozReview-Commit-ID: LxLDWlsIlSk
2017-11-28 14:13:59 -08:00
Shane Caraveo
460fc01e51 Bug 1419880 first round of TODO/FIXME comment updates, r=mixedpuppy
MozReview-Commit-ID: 6GsqWSBKB2d
2017-11-22 11:54:07 -08:00
Kirk Steuber
63ae96269e Bug 1394851 - downloads.download API should default to use Firefox's "Save As" pref r=kmag
This patch changes the behavior of the downloads.download API's saveAs option. Previously, the behavior when neither value is provided (the "default behavior") was not defined by our documentation or Chrome's. Now, the default behavior is changing to rely on the Firefox "Save As" pref (browser.download.useDownloadDir). If Firefox is configured to open the "Save As" dialog for all downloads (browser.download.useDownloadDir == false), that behavior will be the default for the downloads.download API. Otherwise, the default behavior will be not to show the dialog.

This patch also moves some test functionality out of test_chrome_ext_downloads_saveAs.html. Previously, that test would test the saveAs option and also the conflictAction:"uniquify" option. In order to add testing for the new default behavior, it was necessary to move the testing of the conflictAction:"uniquify" option to a new test: test_chrome_ext_downloads_uniquify.html

MozReview-Commit-ID: u6VA4kexlr
2017-10-04 14:39:58 -07:00
Paolo Amadini
0d0c9d5f71 Bug 1402279 - Part 2 - Unify the usage of the DownloadPaths module. r=mak,aswan
MozReview-Commit-ID: HEhwkyxtYTP
2017-09-27 12:13:07 +01:00
Sebastian Hengst
3c4ab8939c Backed out changeset 41da9c5daa90 (bug 1402279) 2017-09-26 18:17:51 +02:00
Paolo Amadini
9fb8dd6d05 Bug 1402279 - Part 2 - Unify the usage of the DownloadPaths module. r=mak,aswan
MozReview-Commit-ID: HEhwkyxtYTP
2017-09-26 16:03:24 +01:00
Tim Nguyen
08e551cf4e Bug 1392270 - Fix download.estimatedEndTime calculation. r=aswan
MozReview-Commit-ID: HqyYLtTC3N6
2017-08-22 20:32:11 +02:00
Thomas Wisniewski
c52894bdf4 Bug 1392003 - Support estimatedEndTime in DownloadItem; r=aswan
MozReview-Commit-ID: 4Yzj52qI1Mz
2017-08-19 15:06:46 -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
Rob Wu
37467a9494 Bug 1362448 - Support "incognito" in downloads.create r=aswan
MozReview-Commit-ID: HN3x6eFT9xB
2017-07-14 17:14:18 +02:00
Kris Maglione
c4d42444e0 Remove unused lazy imports. r=trivial (no bug)
MozReview-Commit-ID: rqUFJw7Wsb
2017-08-02 21:09:38 -07:00
Tomislav Jovanovic
bf271b49fb Bug 1383262 - Better download() error message and default filename r=aswan
MozReview-Commit-ID: IbPb2sj3AQ9
2017-07-30 02:36:08 +02:00
Andrew Swan
ab32078a6b Bug 1350151 Part 3: Use requireUserInput for downloads.open() r=kmag
MozReview-Commit-ID: GhXBZ5sWlRt
2017-07-25 23:01:05 -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
4b8df9ba3a Bug 1374237 - Part 2: Declare all top-level functions in toolkit API files files via const., r=mixedpuppy
Also changed some function names to attempt to guarantee uniqueness across API files.

MozReview-Commit-ID: GnwWwTADF3a
2017-06-21 14:29:37 -04:00
Mark Striemer
a281affe2d Bug 1369782 - Require user interaction for downloads.open() r=aswan
MozReview-Commit-ID: 9RkIOfZEfnf
2017-06-02 18:34:08 -05: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
Tomislav Jovanovic
83e9e8377e Bug 1367572 - Remove uniquified file when used in combination with saveAs option r=aswan
MozReview-Commit-ID: 4atukwcsZgA
2017-06-06 00:37:41 +02:00
Kris Maglione
db3ec327d2 Bug 1368189: Move more code out of ExtensionUtils.jsm. r=mixedpuppy
Also removes some dead code.

A lot of the code in ExtensionUtils.jsm is not needed in all processes, and a
lot of the rest isn't needed until extension code runs. Most of it winds up
being loaded into all processes way earlier than necessary.

MozReview-Commit-ID: CMRjCPOjRF2
2017-05-26 15:44:41 -07:00
Andrew Swan
b37f8b08cf Bug 1344822 Remove downloads.onChanged hack r=mixedpuppy
This bug highlights a difference between "legacy" downloads and those
created directly from Downloads.jsm, that the onDownloadCreated event for
legacy downloads comes when the download is already in progress while the
same event for non-legacy downloads comes before the actual transfer starts.
A clumsy workaround was originally used to avoid generating nonsense
onChanged events for non-legacy downloads but if we are just careful to
handle downloads that have not yet started, we don't need the workaround.


MozReview-Commit-ID: 7QyKvnR5ZMN
2017-05-08 11:13:15 -07:00
Alexandre Poirot
208511b0d3 Bug 1356231 - Use toolkit EventEmitter.jsm instead of devtools module. r=mossop
MozReview-Commit-ID: 49JI7NtLwKK
2017-04-27 17:58:09 +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
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
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
Jared Wein
21fc75d491 Bug 1326479 - Fix 'indent' eslint errors now that eslint scans multiline array and object definitions. r=Gijs
MozReview-Commit-ID: 99mWjxu8PPn
2017-01-03 10:07:50 -05:00
Tomislav Jovanovic
ba969996c8 bug 1247793 - Implement download() options: method, headers and body, r=aswan
MozReview-Commit-ID: 2muhcweY8Fo
2016-10-22 12:06:22 +02:00
Tomislav Jovanovic
4d2be23e86 Bug 1247791 - Implement options.saveAs for downloads.download, r=kmag
MozReview-Commit-ID: 5MrObsL7eTw
2016-09-19 22:39:22 +02:00
Tomislav Jovanovic
dee0f400d7 Bug 1280044 - handle subdirs in browser.downloads filenames, r=aswan
MozReview-Commit-ID: B4WoMbdxYjV
2016-09-09 19:38:01 +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
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
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
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
Bob Silverberg
1a7d79421b Bug 1265836 - Part 2: Change normalizeTime to return a date rather than a number. r=aswan
Also update browser.history.deleteRange to use normalizeTime

MozReview-Commit-ID: EQ3NLSIRTe8
2016-05-24 09:00:17 -04:00
Andrew Swan
536028776a Bug 1271345 Fix brower.download.download() on blob: urls r=kmag
Calling download() on a blob URL was failing in schema validation
since we weren't propagating the extension principal all the way
to the call to scriptSecurityManager.checkLoadURI...

MozReview-Commit-ID: JgEnQ6yxO4P
2016-05-31 11:42:41 -07:00
Sebastian Hengst
b169ca896f Backed out changeset 800df6b80dc0 (bug 1265836) 2016-05-26 10:32:41 +02:00
Bob Silverberg
e903af75a7 Bug 1265836 - Part 2: Change normalizeTime to return a date rather than a number. r=aswan
Also update browser.history.deleteRange to use normalizeTime

MozReview-Commit-ID: EQ3NLSIRTe8
2016-05-24 09:00:17 -04:00
Bob Silverberg
52bfc3f194 Bug 1265834 - Part 1: Move normalizeTime from downloads into a shared util. r=aswan
MozReview-Commit-ID: GKWBbvTPbGy
2016-05-13 10:18:04 -04:00
Mark Striemer
6f2b028bb4 bug 1245606 - Implement chrome.downloads.getFileInfo r=kmag
MozReview-Commit-ID: 6dfpctduYtp
2016-04-15 16:08:16 -05:00
Andrew Swan
385d4a12a2 Bug 1257137 - Handle bad args in downloads.{pause,resume,cancel}. r=kmag
MozReview-Commit-ID: HKYqlKUMp91
2016-03-26 14:49:51 -07:00
Andrew Swan
e93ecceed5 Bug 1245651 - Implement chrome.downloads.onErased. r=kmag
MozReview-Commit-ID: AIskV6fBOiS
2016-03-22 18:20:11 -07:00
Stuart Colville
ca5de3119d Bug 1245644 - Add chrome.downloads.removeFile. r=kmag
MozReview-Commit-ID: 4picapXsv2x
2016-03-14 16:22:24 +01:00
Mark Striemer
c0aa1b074e Bug 1245636 - Implement chrome.downloads.open. r=kmag
MozReview-Commit-ID: KYBgXTaUSkc
2016-03-14 11:46:43 +01:00