SU Free browser wrapper


#1

Continuing the discussion from What’s up with SketchUp Make?:

I just built a ‘SU Free’ single page browser, using nativefier

Nativefier is a command line tool that allows you to easily create a desktop application for any web site with succinct and minimal configuration. Apps are wrapped by Electron in an OS executable (.app, .exe, etc.) for use on Windows, macOS and Linux.

Electron uses Chrome Embedded Framework…

the local storage works, including ‘remember password’…

it’s much faster, smoother and handles larger models than Safari and it downloads named files…

not sure I can build a PC version on mac yet, but someone else could…

the code I ran was

 nativefier -n 'SU_Free_Browser' "http://app.sketchup.com/app" -p 'osx' -a 'x64' --app-version 1.0.0 --build-version 1.0.1 --app-copyright 'john drivenupthewall' -i ~/Desktop/sketchup_icon.png -m -f --honest --enable-es3-apis

I tried a few flag variations and this is the latest…

it weighs in at 122MB for this configuration, but I’m looking at pruning it down…

john


What’s up with SketchUp Make?
#2

This is interesting! I’m right now tied up in a extension project and can’t really pause to look more into this. However screenshots would be much appreciated. Also, do the shortcuts that collides with normal browser shortcuts works?


#3

I saw this when doing a test run inside a SketchUp UI::HtmlDialog window.

I wonder if the cut and paste works ?


#4

this is with Wed Inspector [WI] open…

this flag may be useful --inject <value> path to a CSS/JS file to be injected (default: )

which ones clash? I know you can set your own in Electron and I think nativefied allows it as well…

some are overridden when WI is open i.e. selection, but that’s are fine when it’s closed…

I can’t get key combo for Print to work, so it’s ignoring the usual browser one…

john


#5

not out of the box…

I can’t get a handle on the buried clipboard, and it’s likely to be some sort of json string…

john


#6

I’m actually not sure since I haven’t used SketchUp Free much but I’ve seen a few people here on the forum having problems with it.


#7

Chrome keyboard shortcuts
https://support.google.com/chrome/answer/157179?hl=en


#8

This also works on windows but… I’ve removed my example to ask if this beaks the EULA. I prefer to tread lightly


#9

@sWilliams, does it run ok?

I made an icon, so I can tell it apart…

there’s a --tray flag for Win to allow app to stay in system tray

sketchup_icon

john


#10

We cannot distribute it (like with all terms of service, “framing” and “embedding” are probably not allowed). But this is something SketchUp should have created (or should create).


#11

as this only requires the web address for the su web app, I can’t see how that’s any different from ‘book marking’ it in any other browser…

‘we’ would only be distributing a browser…

maybe @jbacus will is able to clarify…

distributing injectable user css or js would possibly breach the terms of service…

john


#12

I do not beleive that is what it is.
I think this utility / compiler packages up “snapshot” of a website into a standalone offline working package.
I think your using the package’s internal copy of the website.


#13

there’s no copy ‘inside’, it is just a browser…

as soon as you disconnect, you get a warning…

the gif shows before and after unplugging…

although you can use Electron for ‘internal’ web apps, this configuration is just a headless browser…

once this browser’s run, it’s local storage only holds the same content as Safari or Chrome, no more…

it’s similar to running it in a UI::HtmlDialog with the advantage of preserving your login for Trimble Connect…

john


#14

Hmmm,… and it’s still 155MB ?

I’ll check it out tomorrow. Too tired from fixing other people’s computer all day long.


#15

A browser without browser GUI (chromeless). A headless browser is a CLI process that does not open a GUI at all (and if possible not relies on Quartz / Xorg / Windows Shell).

Most electron app developers usually include all resources and application logic (and electron apps can in principle work offline if they do not strongly depend on web services). It seems to me all that nativefier does is a sketch-up-free-####-x64/resources/app/nativefier.json configuration file that tells electron to load a web page. So basically not much different from a bookmark in a stand-alone browser. SketchUp-related files are only loaded into the cache once you connect to the internet, but they become not part of this app package.

And most mainstream browsers allow to bookmark web pages into a desktop app that opens in a stand-alone process (with no extra “copy” of the browser executables).

Though it would be cool if SketchUp was working with offline mode / local storage, app icon and manifest, integration with installed apps, native notifications, hardware sensors & 6DoF APIs (space navigator) and VR.


#16

?

chrome.exe --app=http://app.sketchup.com/app

This works with chrome portable also if you don’t want to install chrome.


#17

I would normally refer to this ‘type’ as a Single Site Browser [SSB], but it was late…

I have a number of mac apps for making them, but they all have some access restrictions that break SU Free…

i.e. block popups, have local file restriction, or use a smaller subset of javascript then their ‘parent’ engine…

others inherit too much functionality, like all the Shortcuts…

I was actually building, a mac only, CEF SSB when I stumbled across nativefier which is cross platform, far simpler and not massively bigger than CEF on it’s own…

I think a lot of unused ‘app’ overhead can be stripped out, which I’ll look at next…

BTW: If you run Chrome, which I don’t normally, there is a command line start…

the mac version is

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --kiosk --app=http://app.sketchup.com/app

but it seems to block login popups even when the site is white listed…

john


#18

This works for me to allow popups:

chrome.exe --disable-popup-blocking --app=http://app.sketchup.com/app


#19

Kiosk mode is more restricted (think of a display in a museum), apps not.


#20

Regular chrome.exe is 1.556 MB.

DId you say that correct ? … 155.0 MB for nativified browser ?

I just created a shortcut for …

"C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" --kiosk --app=http://app.sketchup.com/app

… and it works great ! No space stolen with toolbar, address bar, menu, etc.

And F12 opens the Developer Tools in a separate window, which is nicer.

But it uses a blurry icon for the taskbar button.


I also see no difference between --kiosk and --force-app-mode ?

EDIT: Oh I see Andreas posted in the meantime …