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

Options page does not work with Chrome/Chromium #12

Closed
tdulcet opened this issue Mar 30, 2021 · 7 comments · Fixed by #16
Closed

Options page does not work with Chrome/Chromium #12

tdulcet opened this issue Mar 30, 2021 · 7 comments · Fixed by #16
Labels
bug Something isn't working

Comments

@tdulcet
Copy link

tdulcet commented Mar 30, 2021

This code block does not work in Chrome/Chromium:

return gettingOption.then((res) => {
showManagedInfo();
console.info("managed config found", res, elOption);
// and disable control
elOption.setAttribute("disabled", "");
elOption.setAttribute("title", browser.i18n.getMessage("optionIsDisabledBecauseManaged"));
// could also set readonly elOption.setAttribute("readonly", "") //TODO: test
return applyOption(option, optionGroup, elOption, res);
});

It causes all the settings to be identified as managed, which effectively disables the options page:
image

This is currently blocking Chrome support for the Awesome Emoji Picker and Unicodify. It is also blocking me from using this library in several other extensions I am developing, like Colab Autorun and Connect.

Originally posted in rugk/awesome-emoji-picker#4 (comment).

@rugk rugk added the bug Something isn't working label Apr 1, 2021
@rugk
Copy link
Member

rugk commented Apr 1, 2021

And I vaguely remember there was some Promise one should comment that would fix that bug. Did not you say something like that?

Anyway, thanks for reporting it here, which is certainly the appropriate place.

@tdulcet
Copy link
Author

tdulcet commented Apr 2, 2021

And I vaguely remember there was some Promise one should comment that would fix that bug. Did not you say something like that?

Yes, in rugk/awesome-emoji-picker#4 (comment). I said that developers can replace the above block with return Promise.reject();, which will make the options page work, but obviously disable the managed options feature.

@rugk
Copy link
Member

rugk commented Apr 2, 2021

So… let's better find the real issue and the real solution for that, don't we?

@tdulcet
Copy link
Author

tdulcet commented Apr 3, 2021

I investigated it several months ago and I believe the issue was that Firefox rejects the promise when a managed option is not found, but Chrome resolves it in that case, although just with an empty object...

@rugk
Copy link
Member

rugk commented Apr 3, 2021

Okay, then theoretically, #12 should fix the issue then (untested).

@tdulcet
Copy link
Author

tdulcet commented Apr 4, 2021

Yes, that works great! Thanks for fixing it. 👍

As expected, I do get some errors in the console, but they are probably better fixed with #11:
image

Also, the Unicodify options page is very skinny (compared to the Awesome Emoji Picker above), but it probably just needs some CSS :
image

@rugk
Copy link
Member

rugk commented Apr 4, 2021

Yeah, also that annoying wrap for helper texts becomes apparent there.
I've opened #17 now for that, as I just saw it was not tracked anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants