Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

it is not possible to close the window if the site uses onbeforeunload  #1151

Description

@Liquidator2048

Bug description

when the site implements the event "onbeforeunload" the windows can not be closed

Steps to reproduce

$  nativefier  --verbose -n example   "https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload"           
Running in verbose mode! This will produce a mountain of logs and is recommended only for troubleshooting or if you like Shakespeare.

Performing async options post-processing.
Inferring user agent for electron 12.0.1 / linux
Grabbing electron<->chrome versions file from https://atom.io/download/atom-shell/index.json
Inferring icon for https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload on linux
Inferring icon from store for https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload on linux
Allowed icon formats when building for linux: [ '.png', '.ico' ]
Got name example from options. No inferring needed
Sanitized filename for example : example
Got 249 icons from gitcloud
Max icon match score: 0
No relevant icon in store.
Trying to extract a .png icon from the page.
Got an icon from the page.
Writing 6.4 kb icon to /tmp/nativefier-13-36-19-iconinfer--153192-HfoIQyAoFDbZ/icon.png
Associated electron v12.0.1 to chrome v89.0.4389.82
Given chrome 89.0.4389.82 on linux, using user agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36

Preparing Electron app...
Copying electron app from /home/user/.config/yarn/global/node_modules/nativefier/app to /tmp/nativefier-13-36-19-app--153192-jp3SHBb57M5W
Writing app config to /tmp/nativefier-13-36-19-app--153192-jp3SHBb57M5W/nativefier.json
No files to inject, skipping copy.
Updating /tmp/nativefier-13-36-19-app--153192-jp3SHBb57M5W/package.json 'name' field to example-nativefier-215683

Converting icons...
Building for Linux and icon is already a .png, no conversion needed
Copying icons if necessary
Copying icon /tmp/nativefier-13-36-19-iconinfer--153192-HfoIQyAoFDbZ/icon.png to /tmp/nativefier-13-36-19-app--153192-jp3SHBb57M5W/icon.png

Packaging... This will take a few seconds, maybe minutes if the requested Electron isn't cached yet...
  electron-packager Electron Packager 15.2.0
  electron-packager Node v14.16.0
  electron-packager Host Operating system: linux 5.11.11-200.fc33.x86_64 (x64) +0ms
  electron-packager Packager Options: {"arch":"x64","asar":false,"darwinDarkModeSupport":false,"dir":"/tmp/nativefier-13-36-19-app--153192-jp3SHBb57M5W","electronVersion":"12.0.1","icon":"/tmp/nativefier-13-36-19-iconinfer--153192-HfoIQyAoFDbZ/icon.png","name":"example","out":"/home/user/apps","overwrite":true,"platform":"linux","targetUrl":"https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload","tmpdir":false,"win32metadata":{"ProductName":"example","InternalName":"example","FileDescription":"example"}} +0ms
  electron-packager Target Platforms: linux +1ms
  electron-packager Target Architectures: x64 +0ms
  electron-packager Inferring appVersion from version in /tmp/nativefier-13-36-19-app--153192-jp3SHBb57M5W/package.json +0ms
  electron-packager Application name: example +6ms
  electron-packager Target Electron version: 12.0.1 +0ms
  electron-packager Ignored path regular expressions: [
  '/package-lock\\.json$',
  '/yarn\\.lock$',
  '/\\.git($|/)',
  '/node_modules/\\.bin($|/)',
  '\\.o(bj)?$',
  '/tmp/electron-packager'
] +0ms
  electron-packager Downloading Electron with options {"platform":"linux","arch":"x64","version":"12.0.1","artifactName":"electron"} +0ms
Packaging app for platform linux x64 using electron v12.0.1
  electron-packager Creating /home/user/apps/linux-x64-template +3ms
  electron-packager Extracting /home/user/.cache/electron/3e6d7042e0da86ea4ea04060f7d0c458d1f8a2343ec801482bb2623dfa69ba87/electron-v12.0.1-linux-x64.zip to /home/user/apps/linux-x64-template +0ms
  electron-packager Initializing app in /home/user/apps/example-linux-x64 from /home/user/apps/linux-x64-template template +0ms
  electron-packager Ignored paths based on the out param: [
  '/home/user/apps/example-darwin-x64',
  '/home/user/apps/example-darwin-arm64',
  '/home/user/apps/example-linux-ia32',
  '/home/user/apps/example-linux-x64',
  '/home/user/apps/example-linux-armv7l',
  '/home/user/apps/example-linux-arm64',
  '/home/user/apps/example-linux-mips64el',
  '/home/user/apps/example-mas-x64',
  '/home/user/apps/example-mas-arm64',
  '/home/user/apps/example-win32-ia32',
  '/home/user/apps/example-win32-x64',
  '/home/user/apps/example-win32-arm64'
] +2s
  electron-packager Renaming electron to example in /home/user/apps/example-linux-x64 +38ms

Finalizing build...
App built to /home/user/apps/example-linux-x64, move to wherever it makes sense for you and run the contained executable file (prefixing with ./ if necessary)
Menu/desktop shortcuts are up to you, because Nativefier cannot know where you're going to move the app. Search for "linux .desktop file" for help, or see https://wiki.archlinux.org/index.php/Desktop_entries

click on the link and nothing happening

Expected behavior

Show a confirmation popup when the link is clicked ( ? )

Actual behavior

The window cannot be closed and external links don't work

Context

  • Nativefier: 43.0.0
  • Node.js: 14.16.0
  • Yarn: 1.22.10
  • OS: GNU/Linux ( Fedora 33 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions