[Bug - Edge Browser] chrome.storage.managed API broken in Edge 128+
Describe the bug
The chrome.storage.managed API (to get policies) is currently broken in Edge Beta/Dev/Canary. This breaks my extension (Legacy Browser Support), and breaks all extensions using enterprise policies.
To Reproduce Steps to reproduce the behavior:
- Install any MV3 extension that uses a ServiceWorker and has the
storagepermission. I used Cornify in my testing. - In edge://extensions, open DevTools for the extension's
ServiceWorker - Run this snippet in the console:
chrome.storage.managed.get('this_string_does_not_matter').then(() => console.log('policies work fine'));
Expected behavior The snippet prints "policies work fine" in the console.
Actual behavior
The snippet prints nothing to the console, because chrome.storage.managed.get() never completes.
Screenshots N/A
Desktop (please complete the following information):
- OS: Windows
- Browser: Edge Beta
- Version: 128.0.2739.9
Additional context Edge 127 and below work fine. I couldn't repro this issue in Chromium, so it looks like a downstream regression. Assuming Edge uses the same release schedule as Chromium, Edge 128 reaches Stable next week.
Please help me route this bug to the Edge team for prioritization
I tried n followed the repro steps in three variants for Edge. But I was not able to repro with the three variants of Edge
Stable : Version 127.0.2651.86 (Official build) (64-bit) Beta : Version 128.0.2739.22 (Official build) beta (64-bit) [Nicolas, can you check on this version of Beta?] Canary : Version 129.0.2772.0 (Official build) canary (64-bit)
I am running Microsoft Windows [Version 10.0.22631.3880]
Thanks for reaching out. I am part of Edge Extensions team.
I was able to repro this issue. Thanks to Nicolas for providing a consistent repro. things work fine the first time with a fresh profile. But after restarting Edge, I started getting the bug.
@mukul-p How optimistic are you about fixing this before 128 reaches Stable? IIUC that's in <1 week, so it's a very tight timeline.
I ask because my extension does await chrome.storage.managed.get(...) during startup. If it never resolves, the entire extension is broken. In retrospect, maybe that wasn't the best design decision.
I can always hotfix it with a workaround (by breaking policies), but IME Edge Add-ons reviews take close to a week. I suppose it would be prudent for me to submit my hotfix for review today...
Will be fixed in the 128 release taking place this week? @mukul-p
This is fixed in Stable 128. The fix for Beta and lower channels is being worked upon. Stable rollout has started, so do verify when you get the update and revert back. Thanks for the patience.
It is still not working on the latest 130.0.2849.46 build.
we also never had any issues before 130.0.2849.46. Today, multiple customers using our extension are reporting it is not working. When we debug it is the same issue. When we do chrome.storage.managed.get we get an exception "Error: Extension Context Invalidated. at chrome-extension://
Please note that Chrome with same version is working FINE.
we also never had any issues before 130.0.2849.46. Today, multiple customers using our extension are reporting it is not working. When we debug it is the same issue. When we do chrome.storage.managed.get we get an exception "Error: Extension Context Invalidated. at chrome-extension:// "
@demirten and @apurvabhansali, Is this on the stable channel or the beta channel of 130.0.2849.46?
The original issue has only been a beta channel problem as the code related to this is disabled for stable. This code disablement has not changed for the v130 stable release. If this is occurring on stable, this may be a separate issue.
The fix for this issue is tracking to the v131 beta. It is currently in the Dev channel 131.0.2889.0 if you'd like to test there.
Hi, this is happening in customer production environments where the browser just got updated to 130.0.2849.46. I performed the same update on my own laptop and am seeing the same issue.
If I remove my profile and sign-in using my profile again, then it works, but if I close the browser and reopen it, the api again fails.
Doing some more debugging and will update.
@6112 is it possible for you to test out your extension with the Edge current dev channel for v131 that is available now, or a Edge v131 beta that will be available next week around Thursday? I'd like to be sure the change corrects your original issue and does not regress other areas for you.
Ok, some more steps. When I bring up the browser I am currently in this situation with profiles (this is when I click the profile icon in the top left corner)
Now, if I select my "Work" profile (this profile has our extension loaded) and click on our extension icon at the top, we call chrome.managed.storage.get. This is failing at this point.
Now, I can go to ... -> settings -> profile and I see the following
If I delete profile 1 at the bottom and then close the browser, then the icon in my taskbar changes to:
If I click the incorrect icon, the Edge browser starts again and if I click the profile icon in the top left corner, I again see the first screen shot I have posted above. Once again I select my work profile and now clicking the extension causes chrome.managed.storage.get call to work properly. I once again close the browser, and now the icon is restored to what is seen below.
When I click the icon, again I start like the first screenshot showing profile 1 at the top. If I again select my work profile (2nd time after delete profile 1), I am back in the same situation where clicking our icon causes our extension to call chrome.managed.storage.get and the call fails.
I can rinse and repeat by deleting profile 1, then it will work the first time I select my work profile and after the 2nd time it will not work.
Hope this helps. Again, all done in production browser. Let me see if I can test with the 131 channel.
Apurva
same problem in v131 dev channel browser. Only difference is that I don't see this phantom profile 1 and when I click the icon in the top right corner. Basically, the browser always starts with my work profile, and the extension is not working by failing the chrome.managed.storage.get call. I remove my profile by going to "...->settings->profiles" and clicking the trash can icon next to my profile. if I close and restart the browser, I am prompted to sign in again and I select my account. It now again logs me into my work profile and the extensions works the first time. If I close the browser and re-open it defaults to my work profile, but extension is not working again.
Again, I can rinse and repeat, if I delete the profile and start over, it works the first time, but no time after that.
And just to re-iterate, this was all working fine before our customers (and myself) upgraded to v130 on stable production browser. Also, no issue on Chrome after V130 upgrade.
@6112 is it possible for you to test out your extension with the Edge current dev channel for v131 that is available now
My extension is broken on Beta (130.0.2849.46), and working on Dev (131.0.2889.0).
I haven't tested with a fresh profile like @apurvabhansali, though
I have a 3rd customer with 100+ employees that are all affected by this 130.0.2859.46 release breaking our extension. We use the managed storage api so that enterprise customers can push the settings for our extension via group policy. I would suspect many extensions do this and are currently broken.
Any feedback on why this has broken? I think this will heat up with our customers next week.
Our extension is also stopped working because the managed storage api (which worked in Edge 129) is not working in Edge 130.0.2849.46
Same here from 130, we need a solution ASAP!
Same here from 130. This issue is extremely critical for us. We request an urgent fix.
@mkruger-msft @ManikanthMSFT is it possible to get a status update on this issue? Has your team been able to recreate the issue and any ETA on a fix? As you can see it is affecting multiple folks and is critical because I'm sure like our extension, most extensions are using this API to read enterprise wide settings for their extension that are pushed out via GPO, so it will render the extension DOA until it is resolved.
Hey @apurvabhansali, we are currently looking into the issue and will update you as soon as we have more information.
We appreciate your patience in the meantime.
@ManikanthMSFT we have recently found the same issue. It looks like in our case 129 was working fine, 130 was broken again, and then the current dev 131 seems to be fine again.
So a known defect from August was now released in production with v130 ... Multiple enterprise customers are complaining now and all I can do is tell them to use Chrome or Linux (as Edge 130 on Linux works) ...
@ManikanthMSFT we have recently found the same issue. It looks like in our case 129 was working fine, 130 was broken again, and then the current dev 131 seems to be fine again.
So for us v131 is not working either. I don't know if @takakobem @StasSeraphic and @andreyta2020 can try on 131 also.
@apurvabhansali with 131 it seemed to work properly on the first launch, but it stopped working from the second time onwards.
@ManikanthMSFT we have recently found the same issue. It looks like in our case 129 was working fine, 130 was broken again, and then the current dev 131 seems to be fine again.
So for us v131 is not working either. I don't know if @takakobem @StasSeraphic and @andreyta2020 can try on 131 also.
131 seems to work for us
Same here on 130 but works on 129 , and I'm in similar situation to @apurvabhansali on 131 in dev channel (my extension works for the first time on 131, but it isn't working after restarting edge)
Even on 130, it works for the first time if I reinstall edge, but it stops working again after retarting edge
@ManikanthMSFT we have recently found the same issue. It looks like in our case 129 was working fine, 130 was broken again, and then the current dev 131 seems to be fine again.
So for us v131 is not working either. I don't know if @takakobem @StasSeraphic and @andreyta2020 can try on 131 also.
Oh right it worked at first, probably due to it being a fresh install. After restarting it runs into the same issue it looks like.
My observation is that it is not just after fresh install. If you delete your profile and restart edge, then it will work fine the first time, but then after that it does not work. It has something to do with user profile.
Hey @apurvabhansali, we are currently looking into the issue and will update you as soon as we have more information.
We appreciate your patience in the meantime.
@ManikanthMSFT Please provide some update. We have had to advise customers to use Chrome until this is resolved. We would be more than happy to assist by creating accounts on our server so you can use our extension and recreate the issue.
This issue is also negatively affecting AdBlock in the 130.0.2849.46 version of MS Edge on Windows 11. We've had a large number of users report various issues with Adblock on MS Edge.
An update from Microsoft regarding this issue would be very helpful.