gecko-dev/mobile
Rob Wu 2a62c0c6f2 Bug 1748158 - Omit sender.frameId if sender.tab is unset r=rpl,geckoview-reviewers,jonalmeida
`sender.frameId` should be set iff `sender.tab` is set, as documented at
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender
The removal of the `viewType == "tab"` condition broke this in
https://hg.mozilla.org/mozilla-central/rev/2dc4f1baccc8

This patch makes the presence of `frameId` conditional on `tab`, and
fixes several tests that relied on the incorrect behavior:

- Move the runtime.onConnect test from test_ext_contentscript_in_background.js
  to a new mochitest at test_ext_runtime_connect_iframe.html.

- Simplify test_ext_contentscript_in_background.js to continue to
  provide test coverage for contentScripts.register + allFrames.

- Replace runtime.onConnect with runtime.getFrameId in
  test_ext_contentscript_xorigin_frame.js, since sender.frameId is no
  longer available in xpcshell tests (because internals to support the
  tabs extension API are not available in xpcshell tests). The test
  cannot be moved to a mochitest because its purpose is to provide test
  coverage for process switching in a xpcshell test (bug 1580811).

Differential Revision: https://phabricator.services.mozilla.com/D135057
2022-01-06 14:15:47 +00:00
..
android Bug 1748158 - Omit sender.frameId if sender.tab is unset r=rpl,geckoview-reviewers,jonalmeida 2022-01-06 14:15:47 +00:00
locales Bug 1733495 - Migrate plugins.properties to aboutPlugins.ftl. r=Gijs,fluent-reviewers,nbaumgardner,kpatenio 2021-11-22 09:16:25 +00:00
.eslintrc.js