Skip to content

Commit 8833e6f

Browse files
committed
Added early return to modals.init() if modal undefined to support non-div .open()s ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-widescreen]
1 parent f11df72 commit 8833e6f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

chrome/extension/components/modals.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ window.modals = {
3737
},
3838

3939
init(modal) {
40+
if (!modal) return // to support non-div this.open()s
4041
if (!this.styles) this.stylize() // to init/append stylesheet
4142
modal.classList.add('no-user-select', this.class) ; modal.parentNode.classList.add(`${this.class}-bg`)
4243
dom.fillStarryBG(modal) // add starry bg

firefox/extension/components/modals.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ window.modals = {
3737
},
3838

3939
init(modal) {
40+
if (!modal) return // to support non-div this.open()s
4041
if (!this.styles) this.stylize() // to init/append stylesheet
4142
modal.classList.add('no-user-select', this.class) ; modal.parentNode.classList.add(`${this.class}-bg`)
4243
dom.fillStarryBG(modal) // add starry bg

0 commit comments

Comments
 (0)