Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] UI changes to alpha version of browser extension breaks migaku mpv #14

Open
christofferaakre opened this issue Jan 21, 2022 · 0 comments

Comments

@christofferaakre
Copy link
Contributor

Users of the alpha version of the browser extension are getting an error saying
'Subtitle styling is not available for the selected language.' (in a HTML alert) when trying to click the MPV subs button. The subs in MPV do not get styled, and none of the functionality of migaku MPV works. I have looked at the source code, and am pretty sure I have found the issue.
Start a video in mpv, press b to launch the browser window. Now, open the console and try to log lang and parser. You should get 'Disabled' and null respectively. Then, select a language such as japanese in the extension, press parse, and repeat. Now, you should get 'ja' and 'ja'. Users who are experiencing this issue instead get null. Looking at the source code, lang being null means parser will never be set, so it too will be null forever.

lang should be set in grabLangSettings:

function grabLangSettings() {
    var lang_elem = document.getElementById('migaku-toolbar-lsp-selected');
    var loading_elem = document.getElementById('migaku-toolbar-loading');

    if (!lang_elem || loading_elem)
         return;

    lang = lang_elem.dataset.lang;
    ...

This issue only happens on the alpha version of the extension because the css selector for lang_elem is harcoded, and the layout of the extension has been changed. To fix this, this function needs to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant