зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1388066 - Fix message sender.tab when tabId is 0 on Firefox for Android. r=mixedpuppy,zombie
MozReview-Commit-ID: DPu6EZVg1nN --HG-- extra : rebase_source : 95578d235fd065ae84ac5e2d3a307321854e1d14
This commit is contained in:
Родитель
6bdc69c563
Коммит
8a0d711aa4
|
@ -6,7 +6,7 @@ XPCOMUtils.defineLazyModuleGetter(global, "EventEmitter",
|
|||
// This function is pretty tightly tied to Extension.jsm.
|
||||
// Its job is to fill in the |tab| property of the sender.
|
||||
const getSender = (extension, target, sender) => {
|
||||
let tabId;
|
||||
let tabId = -1;
|
||||
if ("tabId" in sender) {
|
||||
// The message came from a privileged extension page running in a tab. In
|
||||
// that case, it should include a tabId property (which is filled in by the
|
||||
|
@ -17,7 +17,7 @@ const getSender = (extension, target, sender) => {
|
|||
tabId = tabTracker.getBrowserData(target).tabId;
|
||||
}
|
||||
|
||||
if (tabId) {
|
||||
if (tabId != null && tabId >= 0) {
|
||||
let tab = extension.tabManager.get(tabId, null);
|
||||
if (tab) {
|
||||
sender.tab = tab.convert();
|
||||
|
|
Загрузка…
Ссылка в новой задаче