1j01 / 98

💿 Web-based Windows 98 desktop recreation █████▓█▓▓▒▓▒▒░▒░░░🗕︎🗗︎🗙︎
https://98.js.org
1.15k stars 183 forks source link

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

Open 1j01 opened 2 months ago

1j01 commented 2 months ago

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"): https://github.com/1j01/98/blob/7357f921c5d0f8fb2b8c55d63860e4dbbb54e486/lib/os-gui/%24Window.js#L485-L492