Summary
The "PDF (Native)" frame in the LaTeX editor (src/packages/frontend/frame-editors/latex-editor/pdf-embed.tsx) calls jQuery's .focus() on the <embed type="application/pdf"> element:
function focus(): void {
actions.set_active_id(id);
$(embedRef.current).focus();
}
This routes the focus event through jQuery 3's leverageNative shim (the code that makes focus/blur/click bubble on elements that don't natively bubble them). In Opera, the bundled PDF plugin on that <embed> fires synthetic events that re-enter the shim and corrupt the value jQuery stored in its private data slot. The next dispatch then crashes with:
TypeError: H.slice is not a function
at HTMLEmbedElement.handler (jQuery event.trigger leverageNative path)
Reported on an onprem install (cocalc.gwdg.de, Opera 130), triggered by mousing over the PDF pane after a build (the onMouseEnter={focus} overlay).
Fix
Drop the jQuery wrapper and call the native DOM focus() directly — no leverageNative path, no jQuery-3 recursion bug:
function focus(): void {
actions.set_active_id(id);
embedRef.current?.focus?.();
}
No behavior change expected on Chrome/Firefox; fixes Opera.
Workaround for users on old builds
Switch the frame tab from "PDF (Native)" to "PDF - Preview" (PDF.js), or use Chrome/Firefox.
Summary
The "PDF (Native)" frame in the LaTeX editor (
src/packages/frontend/frame-editors/latex-editor/pdf-embed.tsx) calls jQuery's.focus()on the<embed type="application/pdf">element:This routes the focus event through jQuery 3's
leverageNativeshim (the code that makesfocus/blur/clickbubble on elements that don't natively bubble them). In Opera, the bundled PDF plugin on that<embed>fires synthetic events that re-enter the shim and corrupt the value jQuery stored in its private data slot. The next dispatch then crashes with:Reported on an onprem install (cocalc.gwdg.de, Opera 130), triggered by mousing over the PDF pane after a build (the
onMouseEnter={focus}overlay).Fix
Drop the jQuery wrapper and call the native DOM
focus()directly — no leverageNative path, no jQuery-3 recursion bug:No behavior change expected on Chrome/Firefox; fixes Opera.
Workaround for users on old builds
Switch the frame tab from "PDF (Native)" to "PDF - Preview" (PDF.js), or use Chrome/Firefox.