Why Addon Debugger doesnt display Content scripts in Sources?

Why this happens? I try to load data from file but when I press F10 it does not jump into the callback function. .initiated is false.

In Firefox Toolbox it will freeze - I added bookmark to #176 but after pressing F10 it freezed (I see no action).

The errors:

It’s telling you whats wrong: currentNameSpace.data is undefined

I know it is undefined. But why the data was not loaded? This is the first problem.

The second problem (the first error) is clear from the initiating code:

mynamespace.easy.load_data(); // loaded later
    mynamespace.easy.restore(); // loaded before load_data finished

Edit:
I have removed the call
mynamespace.easy.restore();
but the errors still are the same.

This is the code to load data:

currentNameSpace.easy.load_data = function(e) {
  if (!currentNameSpace.easy.initiated )  
    chrome.storage.local.get({easy: undefined,profiles: undefined, default_profiles: undefined},
      (result) => { 
        currentNameSpace.data.easy = result.easy;
        currentNameSpace.data.profiles = result.profiles;
        currentNameSpace.data.default_profiles = result.default_profiles;
        currentNameSpace.easy.initiated = true;
        currentNameSpace.easy.restore();
        }
    );
}

currentNameSpace.easy is defined.

edit2
I see that only the function
chrome.storage.local.get
is called and it will not step in the callback. So why the error is Cannot read property ‘easy’ of undefined at Object.currentNameSpace.easy.restore
the restore function should not be called if the callback is not called.

Oh my. I think I know your problem, but lets do a little test first.

Given this code:

console.log('a');
chrome.storage.local.get(..., () => {
    console.log('b');
});
console.log('c');

What do you think is the guaranteed order in which a, b and c will be logged?

Should be a, c, b… But why the debugger does not pause at the b?

In fact what happens - pseudo code:

loaddata();
chrome.storage.local.get(...,  () => {
    restore();
    console.log('error: data not found');
});

// there is no function call here, at the current code

Ok. Form your previous post I thought you completely missed the concept of asynchronous callbacks, but it appears thats not the case.

But I have to say that I can’t help you like this. I thing if I saw your code I’d find it quite quickly, but this is just guessing.

If I would managed to install web-ext and check for errors and upload it to AMO beta channel, could you check the code? I currently have no idea if I will manage to install the web-ext because the node installers are tricky and often buggy.

node installers are tricky and often buggy

I don’t think web-ext has any dependencies that use node-gyp, so installing it should be a simple matter of npm i web-ext.

But a much more convenient way would be to create a repository on GitHub or something similar.

But I do not wish to publish my source codes or images. I would like to publish it as package xpi if it is possible to debug it (I did not try debug any xpi yet). The problem with this is that somebody can download my work and claim it to be his job… So until it is on the AMO, I am not volunteer to publish the code in public domain.

An XPI package that is debuggable would contain exactly the same information as your source code (it’s just a ZIP archive of your code, after all).

claim it to be his job

Being the first to publish it on amo puts the same claim of creation to it as being the first to publish it anywhere else.

Besides, publishing your source code (without an open souce license) doesn’t mean your code is open source (see here). If someone “takes” your code (for anything else than strictly personal use (which you wouldn’t know of anyway)) it’s still theft (according to most/all legal systems in the world).

That seems like a problem with the console that doesn’t properly support more than ASCII, which the MS DOS console sadly is a case of.

There is:

If your add-on is intended for a limited audience you should choose Preliminary Review instead of Full Review.

Where can I select “Preliminary Review” on the
https://addons.mozilla.org/en-US/developers/addon/submit/2 page?

again, this is not a bug with web-ext but the console you’re running it from.

Ok, I did make a test to cd to ÚČTY and I can confirm it. I deleted the posts with the supposed web-ext bug.

Working on the callback bug fix.

What would you suggest? How to fix the empty object check? Something like:

if (!result.hasOwnProperty("easy"))
   alert("Addon is not installed correctly");

seems too aggressive. Is there some kind of non-aggressive Notification what I could display to user? Something like the notifications used by this site? Something that I don’t need to click on the dialogue.

https://developer.chrome.com/extensions/notifications

Is it possible to make the size of the icon and of the notification box smaller? I used icon of size 16 and the icon is still huge and blured!

You can provide a higher resolution icon with alpha padding

I had this idea too, but it seemed to me to be kind of strange solution.

Does there exist something like FF Toolbox Storage for Chrome? How could I check what is saved in storage in Chrome?