Forum Discussion

pdesoyres's avatar
pdesoyres
New Contributor
3 hours ago

Firefox extension autofill broken on pages with <object> tags — InputJsonDeserializationFailed

Extension version: 8.12.4.46 (also reproduced on 8.12.6-35 beta)
Browser: Firefox 147 / Zen Browser
OS: Linux (Arch, Wayland)
1Password app version: 8.10.74

Problem

When I select an item from the 1Password inline menu to autofill, nothing happens. No fields are filled. This occurs on specific pages (e.g., Clever Cloud login) but not on others (e.g., GitHub login).

Root cause

After extensive debugging, I traced the issue to the collect-page-details code path.

The Clever Cloud login page (https://api.clever-cloud.com/v2/sessions/login) uses an <object> tag to display its SVG logo:

<object class="login-logo" data="https://assets.clever-cloud.com/infra/clever-cloud.svg">
    <img class="login-logo" src="...">
</object>

Firefox's browser.webNavigation.getAllFrames() reports this <object> as a navigable sub-frame. When the extension sends collect-frame-details to this frame, the content script is not injected there (it's an SVG document, not HTML), so the response comes back with data: undefined.

The bug is in the response handling (source file appears to be background/tabs/collect-page-details.ts based on log prefixes):

.then(async a => !a.ok || a.data === null ? Promise.reject() : Ok(a.data))

The strict equality check === null does not catch undefined, so Ok(undefined) is created and pushed into the frames array. When this is later serialized with JSON.stringify, undefined becomes null in the array, and the WASM core fails to deserialize it with error: InputJsonDeserializationFailed

Fix

Change the strict equality check to loose equality:

a.data === null   →   a.data == null

This would catch both null and undefined.

Workaround

Running this in the extension's background console (about:debugging) before autofilling works around the issue:

const origSendMessage = chrome.tabs.sendMessage;
chrome.tabs.sendMessage = function(tabId, message, options) {
    return origSendMessage.call(this, tabId, message, options).then(response => {
        if (response?.data?.collectedPageDetails?.frames) {
            response.data.collectedPageDetails.frames = 
                response.data.collectedPageDetails.frames.filter(f => f != null);
        }
        return response;
    });
};

Notes

  • A similar issue was fixed for Safari in version 8.12.5, but the Firefox extension still has it.
  • Any page using <object>, <embed>, or similar tags that create navigable sub-frames in Firefox will trigger this bug.
  • Pages without such elements (like GitHub) work fine.

Related

Previous report with initial investigation: https://www.1password.community/discussions/developers/firefox-extension-autofill-broken-—-inputjsondeserializationfailed/168275

No RepliesBe the first to reply