Bug 1651838 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

To simulate the error:

1. Open Fenix Nightly and open any tab, e.g. example.com.
2. Use `about:debugging` on desktop to attach a debugger to Fenix. Switch to `geckoview.xhtml` to get a console for the privileged browser process.
3. Use Run the code snippet below.
4. Quit Fenix (swipe away and wait a few seconds).
5. Start Fenix.
6. Click on "Add-ons" - to reproduce bug 1651697


```
/* This script will store an invalid URL in the StartupCache and print the original URL + new URL */
await (async () => {
    let StartupCache = ChromeUtils.import('resource://gre/modules/ExtensionParent.jsm', null).ExtensionParent.StartupCache;
    let modules = StartupCache._data.get('manifests').get('webcompat@mozilla.org').values().next().value.get("en-US").modules;
    let modulesParent = modules.parent.deserialize(window);
    let mod = modulesParent.modules.get("aboutPage");
    console.log(mod.url);
    mod.url = "jar:file:///data/app/org.mozilla.fenix.debug-pZnmlDcQNjaHTbIOkbgbjw==/base.apk!/assets/extensions/webcompat/about-compat/aboutPage.js";
    modules.parent = new StructuredCloneHolder(modulesParent);
    await StartupCache._saveNow();
    return mod.url;
})();
```
To simulate the error:

1. Open Fenix Nightly and open any tab, e.g. example.com.
2. Use `about:debugging` on desktop to attach a debugger to Fenix. Switch to `geckoview.xhtml` to get a console for the privileged browser process.
3. Run the code snippet below.
4. Quit Fenix (swipe away and wait a few seconds).
5. Start Fenix.
6. Click on "Add-ons" - to reproduce bug 1651697 (tested with Nightly 200709)


```
/* This script will store an invalid URL in the StartupCache and print the original URL + new URL */
await (async () => {
    let StartupCache = ChromeUtils.import('resource://gre/modules/ExtensionParent.jsm', null).ExtensionParent.StartupCache;
    let modules = StartupCache._data.get('manifests').get('webcompat@mozilla.org').values().next().value.get("en-US").modules;
    let modulesParent = modules.parent.deserialize(window);
    let mod = modulesParent.modules.get("aboutPage");
    console.log(mod.url);
    mod.url = "jar:file:///data/app/org.mozilla.fenix.debug-pZnmlDcQNjaHTbIOkbgbjw==/base.apk!/assets/extensions/webcompat/about-compat/aboutPage.js";
    modules.parent = new StructuredCloneHolder(modulesParent);
    await StartupCache._saveNow();
    return mod.url;
})();
```

Back to Bug 1651838 Comment 2