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
fix: prevent errors when extensions listen for chrome.tabs
events
#39729
Conversation
Shouldn't the extensions avoid exercising these API when targeting Electron ? Maybe I am missing context, is the plan here for extensions to be able to run in Electron without any modifications, if that is the case what would be the error signal to extension authors when they use any undefined API ? |
@deepak1556 this cropped up initially because several of the main devtools extensions for web frameworks make use of these events (ex. They're not documented as being supported - would it perhaps help if we explicitly noted we did not support them? Prior to this PR we defined |
Thanks for the context, do these extensions work fine when these tab events are declared but not implemented in Electron ? I see most of them as lifecycle related events, not sure if they cause any undefined behavior. For me an error signal seems like the most explicit option for extensions, since Electron is not providing a 1:1 mapping of API from Chrome. However, would also love to hear thoughts from other maintainers on what they think is the best path. |
yes - before adding this i did a brief audit of the most commonly used devtools extensions and found that's how they were indeed used. The thing about extension events generally that makes them tricky is we can't do what we've done for some unsupported functions and e.g. log a warning to console indicating it won't work as expected while allowing the extension to continue to function otherwise. That's what would imo be ideal here but the way extension generated functionality works forces our hand a bit here, and unfortunately these events not being implemented is a direct blocker to #36545 |
769e417
to
8073f5d
Compare
There is a |
@deepak1556 oh great idea - |
8073f5d
to
9c43c41
Compare
Release Notes Persisted
|
I have automatically backported this PR to "25-x-y", please check out #39770 |
I have automatically backported this PR to "27-x-y", please check out #39771 |
I have automatically backported this PR to "26-x-y", please check out #39772 |
…lectron#39729) * fix: prevent errors when extensions listen for chrome.tabs events * chore: mark events unsupported in Electron
Description of Change
Fixes two errors in Chrome extensions that are thrown when extensions listen for
chrome.tabs
. Initially, these weren't added to ourtabs.json
file as we didn't initially intend to support them. However, the way that extension generation works, omitting them from the JSON file actually means that attempting to listen to them at all will throw an error, which we don't want. We don't need to implement them or make them work as intended in order to define them as valid events to listen to here. No documentation or tests are changed as support has not changed as a result of this PR.Checklist
npm test
passesRelease Notes
Notes: Fixed an error where listening to certain
chrome.tabs
events would throw incorrectly.