Fix tab-specific side panel open order
Brought to you by:
tomkozak
Originally created by: KirtiRamchandani
The side panel cookbook sample can open the global side panel when a user tries the tab-specific path, matching the report in [#1179].
The sample called chrome.sidePanel.open({ tabId }) before assigning the tab-specific sidepanel-tab.html path. Because the manifest has a global default_path, Chrome can open the global panel before the tab-specific options are applied.
Set the tab-specific side panel options first, then call chrome.sidePanel.open({ tabId }), in both the extension page flow and the content-script message flow.
npx eslint --no-warn-ignored functional-samples/cookbook.sidepanel-open/script.js functional-samples/cookbook.sidepanel-open/service-worker.js --quietnpx prettier --check functional-samples/cookbook.sidepanel-open/script.js functional-samples/cookbook.sidepanel-open/service-worker.jsgit diff --check HEAD~1..HEADsetOptions precedes open in both tab-specific entry pointsFixes [#1179]
Originally posted by: KirtiRamchandani
Closing this in favor of [#1695]. This PR linked the wrong issue and only reordered the calls; [#1695] keeps the user gesture path focused on chrome.sidePanel.open() and tracks [#1477] directly.
Related
Tickets: #1477
Tickets: #1695
Ticket changed by: KirtiRamchandani