How to load a default project at startup

I need a quick hack to load a default project at startup. Suggestions?

save a project and then share it and then use the link to it as the url you use to start Snap! instead of https://snap.berkeley.edu/snap/snap.html#

Sorry, I didn't specify that I need it for the offline Snap!, so I need to open a local file.

Hi Stefano, I'm also interested in this! AFAIK JavaScript cannot access non-JS files programmatically using the file protocol.

Yes, I guess you are right. But I could assign the content of the default xml file to a variable and then run an "open" command somewhere with that variable as an argument?

Yes, that should work.

Local files access is more and more restricted. Even if you manage to lower some restriction with the cmd line flags, the next browser version may ignore those settings.

.
There is a Web Server for Chrome extension Web Server for Chrome - Chrome Web Store

.
Or, Jens can expand the "-snap-backup-" idea to store default projects in local storage.

.
Snap: source code and media files have been whitelisted for offline use (sw.js). Maybe a some projects URIs can be stored, this way, too.

.
How deep is your offline mode? You want the whole to run from disk (allowing you to make your own version)? Or can run a shared LAN server?
Or use the SnaPP! way to bundle the and the project as a standalone app.
Yes I know, it's currently outdated and does not work with the v8 projects...

Interesting alternative

If this means storing in the browser cache, it wouldn't work for me

The whole Snap! running from disk

I hadn't thought of this. This could be the perfect solution. Are there important reasons why this has not be updated to support v8?

There is an interesting option "Code accessible" that could be important to me (I'm implementing an introductory pseudo-language for high-school students). But, as you said, I got this error message:

So, any quick hack on where to add the automatic load at startup of a project stored in a js variable?

There is a list in Service Worker (sw.js)

 cacheName = 'snap-pwa',
filesToCache = [
'snap.html',
'src/morphic.js',
'src/symbols.js',
...


Browser cache or local storage is used.

It's not updated...

Maybe after it initalizes the ide. I'd suggest looking for where it loads thr cloud project from the url.

[offtopic]

huh, didnt know there was a snap emoji

but its really squished
[/offtopic]

Is the offline Snap! you're using the PWA version or the downloadable ZIP file?

Downloadable zip. What is the difference with the PWA version? (And: where can I find it?)

I wanted to know because I think I have a solution that requires editing the source code a little bit. The good news is that you happen to be using the downloadable ZIP.

For chrome:
Just open a new Snap! instance, click on the three dots:

Then click "Install Snap!..."

Excellent! Let me know