Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Commit

Permalink
Fixed getting started tutorial custom event delivery for FF < 39
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyrat committed Jun 20, 2015
1 parent c224163 commit 4e9cea2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Firefox addon/KeeFox/chrome/content/framescript/keefoxTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,12 @@ keefox_tab.sendStatusToTutorialPageHandler = function (message) {
transferElement.setAttribute("state", JSON.stringify(message.data));
content.document.documentElement.appendChild(transferElement);

let event = new Event("KeeFoxAddonStateTransferEvent", { "bubbles": true, "cancelable": false });
let event;
// From ~FF39 we can use the Event constructor but before that we must use the deprecated
// initEvent approach (despite it being "deprecated" since FF11!)
// event = new Event("KeeFoxAddonStateTransferEvent", { "bubbles": true, "cancelable": false });
event = content.document.createEvent("Events");
event.initEvent("KeeFoxAddonStateTransferEvent", true, false);
transferElement.dispatchEvent(event);
};

Expand Down

0 comments on commit 4e9cea2

Please sign in to comment.