Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: container_node is null when toggling "View as Web Page" in Firefox #94

Open
1j01 opened this issue Jun 30, 2024 · 0 comments
Labels

Comments

@1j01
Copy link
Owner

1j01 commented Jun 30, 2024

In the Explorer app, while viewing a folder, toggling View > as Web Page is causing an error in Firefox:

Uncaught TypeError: container_node is null
    handle_focus_in_out http://127.0.0.1:1998/lib/os-gui/$Window.js:492
    empty jQuery
    render_folder_template http://127.0.0.1:1998/programs/explorer/explorer.js:865
    onConfigure http://127.0.0.1:1998/programs/explorer/explorer.js:239
    configure http://127.0.0.1:1998/src/FolderView.js:170
    toggle http://127.0.0.1:1998/programs/explorer/menus.js:11
    item_action http://127.0.0.1:1998/lib/os-gui/MenuBar.js:883
    add_menu_item http://127.0.0.1:1998/lib/os-gui/MenuBar.js:915
    add_menu_item http://127.0.0.1:1998/lib/os-gui/MenuBar.js:909
    add_menu_item http://127.0.0.1:1998/lib/os-gui/MenuBar.js:896
    MenuPopup http://127.0.0.1:1998/lib/os-gui/MenuBar.js:948
    make_menu_button http://127.0.0.1:1998/lib/os-gui/MenuBar.js:964
    MenuBar http://127.0.0.1:1998/lib/os-gui/MenuBar.js:1084
    <anonymous> http://127.0.0.1:1998/programs/explorer/menus.js:588

logical_container_el.contentDocument is null here as the iframe is unloaded when toggling the folder template ("Web Page"):

98/lib/os-gui/$Window.js

Lines 485 to 492 in 7357f92

function make_focus_in_out_handler(logical_container_el, is_root) {
// In case of iframes, logical_container_el is the iframe, and container_node is the iframe's contentDocument.
// container_node is not a parameter here because it can change over time, may be an empty document before the iframe is loaded.
return function handle_focus_in_out(event) {
// @ts-ignore (not using instanceof for type narrowing, since this needs to work with across iframe contexts)
const container_node = logical_container_el.tagName == "IFRAME" ? logical_container_el.contentDocument : logical_container_el;
const document = container_node.ownerDocument ?? container_node;

@1j01 1j01 added the bug label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant