If possible, making `cookieStoreId` writeable is an option. The option would be of great benefit when an extension has to make an HTTP request from background scripts while maintaining contextual identity (e.g. userscript managers etc) ```js fetch('https://example.com/', { method: 'GET', cookieStoreId: tab.cookieStoreId }) const xhr = new XMLHttpRequest(); xhr.open('GET', 'http://example.com/', true); xhr.cookieStoreId = tab.cookieStoreId; xhr.send(null); browser.downloads.download({ url, filename, saveAs, conflictAction: 'uniquify', cookieStoreId: tab.cookieStoreId }); ```
Bug 1670278 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
If possible, making `cookieStoreId` writeable is an option. The option would be of great benefit when an extension has to make an HTTP request from background scripts while maintaining contextual identity (e.g. userscript managers etc) ```js fetch('https://example.com/', { method: 'GET', cookieStoreId: tab.cookieStoreId }) const xhr = new XMLHttpRequest(); xhr.open('GET', 'http://example.com/', true); xhr.cookieStoreId = tab.cookieStoreId; xhr.send(null); browser.downloads.download({ url, filename, saveAs, conflictAction: 'uniquify', cookieStoreId: tab.cookieStoreId }); ``` Note on `downloads.download` It is possible to set `cookieStoreId: 'firefox-container-1'` but not `cookieStoreId: 'firefox-private'` > Error: Illegal to set private cookieStoreId in a non-private window
If possible, making `cookieStoreId` writeable is an option. The option would be of great benefit when an extension has to make an HTTP request from background scripts while maintaining contextual identity (e.g. userscript managers etc) ```js fetch('https://example.com/', { method: 'GET', cookieStoreId: tab.cookieStoreId }) const xhr = new XMLHttpRequest(); xhr.open('GET', 'http://example.com/', true); xhr.cookieStoreId = tab.cookieStoreId; xhr.send(null); }); ``` Note on `downloads.download` It is already possible to set `cookieStoreId: 'firefox-container-1'` but not `cookieStoreId: 'firefox-private'` > Error: Illegal to set private cookieStoreId in a non-private window ```js browser.downloads.download({ url, filename, saveAs, conflictAction: 'uniquify', cookieStoreId: tab.cookieStoreId !== 'firefox-private' ? tab.cookieStoreId : 'firefox-default' incognito: tab.incognito }); ```
If possible, making `cookieStoreId` writeable is an option. The option would be of great benefit when an extension has to make an HTTP request from background scripts while maintaining contextual identity (e.g. userscript managers etc) ```js fetch('https://example.com/', { method: 'GET', cookieStoreId: tab.cookieStoreId }) const xhr = new XMLHttpRequest(); xhr.open('GET', 'http://example.com/', true); xhr.cookieStoreId = tab.cookieStoreId; xhr.send(null); }); ``` Note on `downloads.download` It is already possible to set `cookieStoreId: 'firefox-container-1'` but not `cookieStoreId: 'firefox-private'` > Error: Illegal to set private cookieStoreId in a non-private window ```js browser.downloads.download({ url, filename, saveAs, conflictAction: 'uniquify', cookieStoreId: tab.cookieStoreId !== 'firefox-private' ? tab.cookieStoreId : 'firefox-default', incognito: tab.incognito }); ```