1

I am developing browser extension for multiple browsers. I have ported my extension from Chrome with Microsoft edge extension toolkit. For demo and testing purposes I have packed it as .appx package and signed it with self signed certificate.

When loaded as unpacked the extension worked perfectly however it seems that the packed version cannot save data into storage.sync. In console I get these messages:

API Call: 'storage.sync'

SCRIPT5007: Unable to set property 'elementContent' of undefined or null reference

What can I do here? Giving the unpacked source codes to testers is not an option.

Hannu
  • 11
  • 2
  • Looks like chrome.storage.sync does not work properly on edge. I used navigator.userAgent to detect if browser in use is Chrome and if not then browser.storage.sync is used instead of chrome.storage. This seems to bypass my problem. – Hannu Apr 26 '18 at 11:56
  • Nope doesn't work. I wish they would set their store right. I have submitted the request form and everything. – Hannu Apr 27 '18 at 07:01
  • Right, it seems that browser.runtime.onInstalled is not working in self signed packages. I wonder if it will work if/when Microsoft accepts the extension into their store. – Hannu Apr 30 '18 at 08:46
  • Can you please narrow down your problem. It is as per design that the unsigned Extension wont be able to use storage.sync API class. An Extension needs to be signed in order to make use of this API. Coming to your Store submission. May I know the Store ID of the submitted extension(from your Dev portal) and the name of your Extension to help you better. – WarPro Jun 13 '18 at 11:44
  • I have the same problem with my edge extension. On Chrome there are no problems and my unsigned extension is also working fine with browser.storage.sync on edge but once i signed it i have this error message "SCRIPT5007: Unable to set property 'length' of undefined or null reference". I think the length is about the "storage.sync" size because i'm trying to save an object with too many values when I reduce my object values to two or three it's begin to work. Then Edge Storage's size may be smaller than the one of Chrome. – user3525616 Jun 13 '18 at 14:16
  • @WarPro I can no longer refer to my code for my fixed term employment contract ended. Also I would now have to ask for the store ID:s from my now former employer. I know that for storage API to work the extension needs to be signed, this is why (for testing purposes) I self signed the package. SCRIPT5007 Message meant that there were no object in sync. Problem was caused by runtime.onInstalled that I used to setup data into sync right after the browser extension was installed. This runtime.onInstalled however would not work with self signed packages. – Hannu Jun 14 '18 at 17:15

0 Answers0