Commit Graph

147 Commits

Author SHA1 Message Date
Rob Wu
e498d721b2 Bug 1287007 - Only close extension tabs upon shutdown r=billm
In one of the previous patches, the viewType of popup changed from
"popup" to "tab". As a result it was closed by the `page-shutdown`
event handler in ext-tabs.js. This prevents that from happening.

Also added a test that checks whether the options page type is a tab, to
prevent future regressions.

MozReview-Commit-ID: 3Qcf08PgNqb
2016-09-08 19:02:56 -07:00
Rob Wu
0b6a21b18a Bug 1287007 - Use IPC to share viewType, tabId and windowId r=billm
Accessing <browser> in ContentChild does not work when extensions run in
a separate process.

MozReview-Commit-ID: EK0aOYeGaZ5
2016-09-06 15:25:10 -07:00
Rob Wu
85f4c6b8ea Bug 1287007 - Rename "context.type" to "context.viewType" r=billm
"viewType" is more easily searchable and not as ambiguous as "type".

MozReview-Commit-ID: 8sG4qagFCBu
2016-09-05 22:26:56 -07:00
Andy McKay
1b0a8253b8 bug 1240631 so that both invalid windows and tabs hit runtime.lastError r=kmag
MozReview-Commit-ID: EflXdTBWEEO
2016-10-21 14:45:18 -07:00
Rob Wu
1adbe191ae Bug 1301862 - Call tabs.create sooner r=kmag
Call tabs.create immediately after the tab is created without delay to
reduce the chance of losing tabs.onUpdated events.

If needed, the tab waiting is done by `executeScript`, etc.

MozReview-Commit-ID: 7A1zH99zafK
2016-09-11 01:32:24 -07:00
Rob Wu
9cfd0fcca8 Bug 1298979 - move tabs.sendMessage/connect to child process r=billm
- Use the frame's message manager to direct messages via the
  ProxyMessenger to the right tab instead of directly to the tab.
- Put the implementation in a separate file that is only loaded in
  child processes (in the future).
- Explicitly list all addon-process specific files in a new category
  instead of reusing the content one.

MozReview-Commit-ID: 8oIMx9ol7Tl
2016-08-28 20:07:46 -07:00
Rob Wu
91820391f9 Bug 1298979 - Add ProxyMessenger, change message managers and getSender r=billm
- Introduce a proxy for IPC messages to allow the following APIs
  to be run out-of-process (ProxyMessenger):

    * runtime.connect
    * runtime.sendMessage
    * tabs.connect
    * tabs.sendMessage
    * runtime.onConnect
    * runtime.onMessage

- Update getSender in ext-tabs, make it independent of the context
  (in particular do not throw an error when a message is received while
  the tab is gone), and move it from MessageChannel to ProxyMessenger to
  make sure that it works in webext-oop. MessageChannel lives in a child
  process, whereas the TabManager (used by getSender) requires data from
  the main process.

- Set the third parameter of `addMessageListener` to true in some places
  to make sure that messages get delivered even after unloading the
  context. This is needed for the next two points.

- Put the `messageManager` property in BaseContext, and let it be set by
  `setContentWindow` - runtime.sendMessage/connect and tabs.sendMessage/
  connect depends on this property, and using the frame message manager
  makes sense.

- Unconditionally use the frame message manager in
  runtime.sendMessage/connect instead of sometimes the cpmm.

MozReview-Commit-ID: 4QkPnlMOkjS
2016-08-25 17:08:08 -07: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
Rob Wu
8472b153c7 Bug 1290157 - Always pass an array to tabs.executeScript on success r=kmag
MozReview-Commit-ID: Ctw8RUtfEZC
2016-08-09 00:28:47 -07:00
Kris Maglione
3531e0dc55 Bug 1225215: [webext] Raise the expected errors when given invalid tab IDs. r=aswan
MozReview-Commit-ID: E5G0GmVhzLh
2016-02-26 17:56:30 -08:00
Kris Maglione
946c03abd0 Bug 1285493: Add-on Manager should not be closed when an add-on with options_ui is disabled. r=billm
MozReview-Commit-ID: 8oRK8uPphDf
2016-07-24 15:05:39 -07:00
Pushpankar
77a14e357c Bug 1286854 - Replace ownerDocument.defaultView with ownerGlobal in browser/. r=dao 2016-07-16 10:20:04 +02: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
Kris Maglione
403332897f Bug 1276025: Stop using injectInDocShell to tag docShells with types. r=billm
MozReview-Commit-ID: 7h5PI2birY4
2016-06-02 20:53:41 -07:00
Wes Kocher
ef8b093de7 Backed out changeset 99b213f494e1 (bug 1276025) for xpcshell bustage CLOSED TREE 2016-06-07 16:59:20 -07:00
Kris Maglione
3b83db606e Bug 1276025: Stop using injectInDocShell to tag docShells with types. r=billm
MozReview-Commit-ID: 7h5PI2birY4
2016-06-02 20:53:41 -07:00
Kris Maglione
ed18f55d09 Bug 1254003: Don't call tabs.create callback before the tab is ready. r=gabor
MozReview-Commit-ID: 3qK6GpTmIFQ
2016-04-03 19:31:47 -07:00
Claas Augner
1737833daa Bug 1247455 - Add a .removeCSS method to complement .insertCSS. r=kmag 2016-04-15 00:39:09 +02:00
Kris Maglione
daea263459 Backed out changeset a3fbed43aa55 for a new set of intermittent failures.
MozReview-Commit-ID: 1lIDylABshC
2016-04-25 18:13:41 -07:00
Kris Maglione
1acdedc255 Bug 1254003: Don't call tabs.create callback before the tab is ready. r=gabor
MozReview-Commit-ID: 3qK6GpTmIFQ
2016-04-03 19:31:47 -07:00
Kris Maglione
6f3240ccb2 Bug 1238310: Part 5 - Implement the browser.tabs.onZoomChange event. r=gabor f=aswan
MozReview-Commit-ID: JlxSM13SeYg
2016-04-01 11:45:01 -07:00
Carsten "Tomcat" Book
7e879bbd62 merge mozilla-inbound to mozilla-central a=merge 2016-04-25 11:55:12 +02:00
Phil Ringnalda
efb295823a Back out a57938cd29d2 (bug 1254003) for timeouts in browser_ext_tabs_* 2016-04-24 22:16:13 -07:00
Kris Maglione
e58eb81098 Bug 1254003: Don't call tabs.create callback before the tab is ready. r=gabor
MozReview-Commit-ID: 3qK6GpTmIFQ
2016-04-03 19:31:47 -07:00
Kris Maglione
57af5fa029 Backed out changeset 8afadb96e977 for too many intermittent failures (bug 1254003).
MozReview-Commit-ID: 2wFCgIaH9lM
2016-04-24 00:39:29 -07:00
Kris Maglione
c71fbe77e2 Bug 1254003: Don't call tabs.create callback before the tab is ready. r=gabor
MozReview-Commit-ID: 3qK6GpTmIFQ
2016-04-03 19:31:47 -07:00
Kris Maglione
fb9a311d22 Bug 1238310: Part 4 - Refactor tab listener code. r=aswan
MozReview-Commit-ID: 66ZXlvepRsz
2016-02-17 11:47:56 -08:00
Kris Maglione
eacbda6ad5 Bug 1238310: Part 3 - Implement the base browser.tabs zoom API. r=aswan
MozReview-Commit-ID: BZEFOnCRMba
2016-04-01 15:44:29 -07:00
Matthew Wein
e265f5e579 Bug 1245355 - Add a unit test for tabs.getAllInWindow. r=kmag
MozReview-Commit-ID: 5wVRCLdCuq9
2016-03-17 09:35:58 +01:00
tofumatt
c760f1a680 Bug 1237822 - Throw error if tabs.query is used without "tabs" permission with url param. r=kmag
MozReview-Commit-ID: 4WpawIYcwnl
2016-03-15 15:39:27 +01:00
Bill McCloskey
21d9408694 Bug 1197346 - Rename ExtensionPage to ExtensionContext (r=kmag) 2016-04-23 20:04:29 -07:00
Sebastian Hengst
865d50e126 Backed out changeset 562dbcad5a6e (bug 1245355) for leaking windows and a docshell in its new test browser_ext_tabs_getAllInWindow.js. r=backout 2016-03-16 19:19:41 +01:00
Matthew Wein
91fecea3a3 Bug 1245355 - Add a unit test for tabs.getAllInWindow r=kmag
MozReview-Commit-ID: 5wVRCLdCuq9
2016-03-15 12:01:40 +01:00
Kris Maglione
e0795d5219 Bug 1220154, 1249830: Handle sendMessage replies with 0 and >1 listeners correctly. r=billm
MozReview-Commit-ID: 7lE7RaJcl7n
2016-03-04 15:40:56 -08:00
Kris Maglione
35884ee2a7 Bug 1253132: [webext] Support window states in browser.windows APIs. r=billm
MozReview-Commit-ID: LIw6swRAB3h
2016-03-05 09:59:35 -08:00
Kris Maglione
d7334ea44a Bug 1248499: [webext] Implement tabs.detectLanguage. r=billm
MozReview-Commit-ID: F4GpSesj2ho
2016-02-26 13:20:28 -08:00
Andy McKay
66ac63cf1a Bug 1248460 - pin during SSTabRestoring. r=kmag
MozReview-Commit-ID: A88UnreihK7
2016-02-29 13:45:36 -08:00
Matthew Wein
52d1cd6bcd Bug 1220124 - Add support for chrome.tabs.onhighlight. r=kmag
MozReview-Commit-ID: BB6vJl8qV4l
2016-02-07 18:35:22 -08:00
Kris Maglione
55354c26e2 Bug 1213993: [webext] Support frameId/allFrames/runAt in browser.tabs.executeScript and insertCSS. r=billm
MozReview-Commit-ID: FgV9vyHVjj8
2016-02-08 17:40:02 -08:00
Luca Greco
fc3ac46ddc Bug 1227462 - tabs.create and tabs.update should check URLs using checkLoadURL. r=kmag
MozReview-Commit-ID: EKFRpoSuXrF
2016-02-25 18:13:59 +01:00
Kris Maglione
8a6a9a1582 Bug 1238313: Part 1 - Implement tabs.onMoved event. r=billm
MozReview-Commit-ID: F2GoU1fzj4s
2016-02-11 14:32:58 -08:00
Kris Maglione
852f68eea9 Bug 1234086: [webext] Add support for tabs.onAttached/onDetached events. r=billm
MozReview-Commit-ID: 4Kk1mTdGflI
2016-02-17 11:52:33 -08:00
Wes Kocher
50a6c0c612 Backed out changeset 5ec466af51e1 (bug 1234086) for failures in browser_ext_tabs_update.js 2016-02-17 14:31:04 -08:00
Wes Kocher
a19d946aed Backed out changeset c893cd374dcd (bug 1238313) 2016-02-17 14:30:56 -08:00
Kris Maglione
6ff4ef3207 Bug 1238313: Part 1 - Implement tabs.onMoved event. r=billm
MozReview-Commit-ID: F2GoU1fzj4s
2016-02-11 14:32:58 -08:00