Open a project with javascript extensions already activated in Firefox

Hello,

I am currently working on presenting an algorithm that I coded with Snap*!* .
I have two questions.

  • Where can I find documentation on the various possible attributes to open/run my project, with a web link?
  • I would like to open it in an executable mode, with javascript extensions already activated in Firefox. Is there a flag that we could set to True inside the project ? And keep our link private.

Thank you.

That will not happen. Someone could bait unwitting users into a link of a project that runs malicious JS code.

What JS-only feature do you need in your project?

I understand. And what about keep my project strictly private ?

And what about my first question :
Where can I find documentation on the various possible attributes to open/run my project, with a web link?

From the reference manual, Chapter XII, G, Preloading a Project when Starting Snap!:

&editMode Start in edit mode, not presentation mode.
&noRun Don’t click the green flag.
&hideControls Don’t show the row of buttons above the stage (edit mode, green flag, pause, stop).
&lang=fr Set language to (in this example) French.
&noCloud Don’t allow cloud operations from this project (for running projects from unknown sources that include JavaScript code)
&noExitWarning When closing the window or loading a different URL, don’t show the browser “are you sure you want to leave this page” message.
&blocksZoom=n Like the Zoom blocks option in the Settings menu.

If you mean, be able to send others the link but it not show up on your profile, then that’s what happens when you just share it. Once you publish it (the option shows up after you share it), then people will be able to find it on the snap website.

Thank you. I apologize for not having searched the documentation thoroughly enough.

When I see the $noCloud parameter, it could be possible to activate javascript extensions inside the project and keep the project private. What do you think about it ?

Ok, I see. Thanks.

Do you mean your own computer? You may use a locally modified copy of :snap: or install a userscript extension to do this “on the fly”.

Hi Nathalie, if you run your project only locally from a file:// url rather than from a http(s):// one JavaScript extensions are going to be activate by default, because in this situation there is little danger of any damage to the cloud. This is e.g. what Joachim Wedekind often uses for his interactive art exhibits.

I will admit that I never knew that.

Wouah ! …
Thank you Jens !

Hi Dardaro, I don’t understand what you mean by
” install a userscript extension to do this “on the fly” “.

Hi Jens, is it possible to open a project directly with an url containing arguments :
file:///Users/nathalie/Sites/Snap-11.0.8/snap.html#present:User=nathalie&noRun&blocksZoom=1.3&ProjectName=myproject_to_present

or something like that ? (my username on my system is ‘nathalie’)

Sorry if it is a stupid question…

I’m afraid, not, Nathalie. We can only enable JavaScript because in this mode there is no way to access the cloud…

Ok, thank you.

There is a thread with useful information Snap! Arcade - #43 by dardoro

There are user script manager extensions for browsers. I’m biased, as I’m slightly addicted to modding the IDE with TamperMonkey

I’m using this script to enable JS for my own shared projects

Snap Auto JS own
// ==UserScript==
// @name         Snap! Auto JS, own
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Auto enable JS
// @author       Snap! || DarDoro
// @match        https://snap.berkeley.edu/snap/snap.html
// @icon
// @grant 		  none
// @run-at document-idle
// ==/UserScript==

(function() {
	let userName = "#present:Username=dardoro";
	if( location.hash.indexOf( userName)==0 || location.hash === ""){
		Process.prototype.enableJS = true;
	};

})();

That’s perfect !

[edit] Sorted, I just re-copied/re-pasted into TamperMonkey - the function red x disappeared and although still got the yellow warning - its works fine :slight_smile:

I’m getting an error that Process isn’t defined

Any ideas why/how to cure?

Process is a proprietary runtime object of the :snap: instance, not known to the TM at editing time.