Skip to content

Commit

Permalink
Fix problems with load-subtitles shortcut and iframed video elements
Browse files Browse the repository at this point in the history
- Removed short-circuit that prevents child iframe video-select-dialog
  listeners from receiving commands.
- But if we do this then any iframe without video elements can show the
  'no video elements' dialog on any 'load-subtitles' command.
- So we just remove the 'no video elements' entirely. This restores the
  behavior from the latest released version of the extension.
  • Loading branch information
killergerbah committed Apr 20, 2024
1 parent cd3e8ce commit afc8fd7
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions extension/src/controllers/video-select-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ export default class VideoSelectController {
}

bind() {
if (window.self !== window.top) {
return;
}

this.messageListener = (
request: any,
sender: chrome.runtime.MessageSender,
Expand Down Expand Up @@ -92,8 +88,6 @@ export default class VideoSelectController {
} else if (this._bindings.length > 1) {
// Toggle on
this._showUi(openedFromMiningCommand);
} else {
this._showNoVideoElementsUi();
}
}

Expand Down Expand Up @@ -122,12 +116,6 @@ export default class VideoSelectController {
client.updateState({ open: true, themeType, videoElements, openedFromMiningCommand });
}

private async _showNoVideoElementsUi() {
const client = await this._prepareAndShowFrame();
const themeType = await this._settings.getSingle('themeType');
client.updateState({ open: true, themeType, videoElements: [] });
}

private async _prepareAndShowFrame() {
this._frame.language = await this._settings.getSingle('language');
const isNewClient = await this._frame.bind();
Expand Down

0 comments on commit afc8fd7

Please sign in to comment.