Safari Web Extensions always outputs errors on every page.

The Zotero connector seems to output an error to every page. The functionality seems to work but this is more of an annoyance to web developers to have to disable the extension on every site we debug.

However there might be some performance loss if the extension is running itself at least 3 times on every page load. And I'm guessing that could potentially cause some errors down the line.

[Error] SyntaxError: Can't create duplicate variable: 'Schema'
[Error] TypeError: undefined is not an object (evaluating 'Zotero.Schema.init')
[Error] SyntaxError: Can't create duplicate variable: 'MESSAGE_SEPARATOR'
[Error] SyntaxError: Can't create duplicate variable: 'isWeb'
[Error] SyntaxError: Can't create duplicate variable: 'ZoteroFrame'
[Error] SyntaxError: Can't create duplicate variable: 'ZOTERO_CONFIG'
[Error] SyntaxError: Can't create duplicate variable: 'Schema'
[Error] TypeError: undefined is not an object (evaluating 'Zotero.Schema.init')
[Error] SyntaxError: Can't create duplicate variable: 'MESSAGE_SEPARATOR'
[Error] SyntaxError: Can't create duplicate variable: 'isWeb'
[Error] SyntaxError: Can't create duplicate variable: 'ZoteroFrame'
  • You're seeing these lines in the JavaScript Console?

    I'm not seeing that. Does it happen with all other plugins disabled? On any webpage (e.g., this one)? What macOS, Safari, and Zotero versions?
  • You were right. It was a conflict with another extension.
    Specifically it was the "Save to Reader" extension from Readwise.

    Looking at the stack trace I see that the error occurs in the .write() (line 9) call of this code in the Readwise extension. Is it possible that the Zotero extension has some problems with iframes? Especially fynamically created. Or is it purely an error on their half?

    try {
    const xn = document.createElement("iframe");
    xn.style.position = "absolute",
    xn.style.left = "-10000px",
    document.body.appendChild(xn),
    fe.push(xn);
    const L = xn.contentWindow.document;
    L.open(),
    L.write("<html><head></head><body>12</body></html>"),
    L.close(),
    F = {
    document: L,
    window: xn.contentWindow
    }
    } catch {}

    Zotero version is 6.0.30
    MacOS version is Sonoma 14.0
Sign In or Register to comment.