Skip to content

Commit

Permalink
fix window.bgReady and window.messageBox
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Oct 11, 2024
1 parent 41832ae commit 3becd89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/js/dom-on-load.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {$, $$, $create, focusA11y} from './dom-base';
import {getEventKeyName, moveFocus} from './dom-util';
import {getEventKeyName, messageBox, moveFocus} from './dom-util';
import HeaderResizer from './header-resizer';
import {t} from './localization';
import {onExtension} from './msg';
Expand Down Expand Up @@ -194,7 +194,7 @@ function interceptClick(event) {
const el = event.target.closest('[data-cmd=note]');
if (el) {
event.preventDefault();
window.messageBox.show({
messageBox.show({
className: 'note center-dialog',
contents: tooltips.get(el) || el.title,
buttons: [t('confirmClose')],
Expand Down
4 changes: 2 additions & 2 deletions src/js/popup-get-styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import browser from '/js/browser';
import * as msg from '/js/msg';
import {API} from '/js/msg';
import {API, isBg} from '/js/msg';
import {CHROME, FIREFOX, getActiveTab, URLS} from '/js/toolbox';

export const ABOUT_BLANK = 'about:blank';
Expand Down Expand Up @@ -60,7 +60,7 @@ export default async function popupGetStyles() {
for (const f of frames) {
if (f.url && !f.isDupe) f.stylesIdx = styles.push(f.styles = API.styles.getByUrl(f.url)) - 1;
}
if (!window.bgReady) {
if (!isBg) {
styles = await Promise.all(styles);
for (const f of frames) if (f.styles) f.styles = styles[f.stylesIdx];
}
Expand Down

0 comments on commit 3becd89

Please sign in to comment.