Skip to content

Updating NW.js #2

@luxzg

Description

@luxzg

This is PROBABLY NOT an issue as a problem in the project's code, but this is only way I can ask the question.

I've unpacked phpbrowserboxv6.2.exe to temporary directory.

Then I unpacked NW.js latest release: nwjs-v0.83.0-win-x64.zip
(Chromium 120, Nodejs 21.1 etc - https://nwjs.io/blog/v0.83.0/ )

.. and tried replacing files in \bin\bbwebkit\ and renaming nw.exe to bbwebkit.exe.

But running the application (phpbrowserbox.exe) shows application window (with content) for like 1 second or less, and then immedately closes.

Is bbwebkit.exe compiled from NW.js code, or is it just a file rename? Can we somehow update just the bbwebkit component?

We can already update PHP manually, MySQL and Apache generally don't change all that fast so I can live with older releases, so it just leaves browser component. If we could manually update in realtively easy way from NW.js that would be awesome.

Thanks for any info, and thanks for working on this project, I've only recently found it and started exploring its capabilities, but I already love it a lot! :-)

Edit: Answer to myself - issue is with some code in \bin\bbwebkit\src, when I remove background.js and point to my own index2.html in package.json it doesn't close and will run PHP code as well (if running index.php)

Edit no 2: If I do as explained above, then edit file bin\bbwebkit\src\index.html so it looks like this:

  • remove 3 scripts from body
  • replace showSplashScreen(); and loadserverUrl(); with simply
	<script>
		const win = nw.Window.get();
		win.show();
		window.location.href= "http://localhost";
	</script> 

... then I can run phpbrowserbox.exe and it works fine, doesn't close the window. I can even leave background.js in package.json. Otherwise some code in preloader.js or background.js closes the page/window.

I still don't see why it closes window with new NW.js binaries, and works normally with original ones from PHPBB 6.2

Edit no 6342 : :-) I found the real culprit. It was so obvious but I did not look...
In file \bin\bbwebkit\src\js\main.js

This code:

function showBrowser(visible) {
    setTimeout(function() {
        win.show();
    },500);
}

If I remove the setTimeout function and just leave win.show(); it works without any other changes. I thought maybe timeout was too small, tried few seconds, it still closes. Again, I don't know why the default app has no issues with this timeout, and updated NW.js closes. But the upgrade seems to be working, I will be testing more tomorrow.

If there's something else to do it in "more correct way" I'm willing to listen. Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions