Skip to content

Commit ecb3a2b

Browse files
authored
use constructor
1 parent 136b8b6 commit ecb3a2b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/addons/addons/editor-animations/userscript.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -430,23 +430,22 @@ export default async function({ addon }) {
430430
}
431431

432432
/* addon modal API */
433-
console.log(addon.tab)
434-
const ogAddonPrompt = addon.tab.prototype.prompt;
435-
addon.tab.prototype.prompt = function(...args) {
433+
const ogAddonPrompt = addon.tab.constructor.prompt;
434+
addon.tab.constructor.prompt = function(...args) {
436435
const modal = ogAddonPrompt.call(this, ...args);
437436
handleOpenAnimation("modal");
438437
attachCloseHijack("modal");
439438
return modal;
440439
}
441-
const ogAddonConfirm = addon.tab.prototype.confirm;
442-
addon.tab.prototype.confirm = function(...args) {
440+
const ogAddonConfirm = addon.tab.constructor.confirm;
441+
addon.tab.constructor.confirm = function(...args) {
443442
const modal = ogAddonConfirm.call(this, ...args);
444443
handleOpenAnimation("modal");
445444
attachCloseHijack("modal");
446445
return modal;
447446
}
448-
const ogAddonCreateModal = addon.tab.prototype.createModal;
449-
addon.tab.prototype.createModal = function(...args) {
447+
const ogAddonCreateModal = addon.tab.constructor.createModal;
448+
addon.tab.constructor.createModal = function(...args) {
450449
const modal = ogAddonCreateModal.call(this, ...args);
451450
handleOpenAnimation("modal");
452451
attachCloseHijack("modal");

0 commit comments

Comments
 (0)