Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,304 Members 40,953 Now Online
XDA Developers Android and Mobile Development Forum

Trident Sandbox : Sandbox Scripting IDE for Windows RT

Tip us?
 
nazoraios
Old
(Last edited by nazoraios; 24th June 2014 at 12:11 AM.)
#1  
Junior Member - OP
Thanks Meter 8
Posts: 28
Join Date: Jun 2013
Default Trident Sandbox : Sandbox Scripting IDE for Windows RT

Attachment 2813343

This is an effort to make the best out of what Microsoft gave us 'out of the box' with Windows RT as far as on-device scripting and coding.
It is an Internet Explorer based scripting IDE which lets you save programs consisting of HTML and JavaScript into a single .PRG file. Internet Explorer's rendering engine is called Trident (version 7 in IE11), and it is a sandboxed environment, so the 'sandboxing' is at the browser level.

I have about 40 sample programs which you can load by looking in the samples subdirectory. Your programs can do simple file I/O as well (save text files or serialize json objects as text files and load them later)... if you are running hosted or appcached version you can use localstorage and/or indexedDB as well.

Now Hosted on GitHub at :
https://github.com/obeliskos/TridentSandbox

(Updated to version 1.88)
- CodeMirror Search enabled
- Added Babylon.js, moment.js, and jsoneditor.js libraries with samples
- API_Restore_TridentDB() now refreshes the trident save slot list
- Added 'Days Since/Days Until' sample app and Streaming Radio for x86 (wmp embed)
- Added Hierarchical Encrypted Notes editor app
- Added Json Databank (dynamic json database app)
- Local FS now shows Samples Browser button for accessing those samples online
- TridentList added functions for setting list item as html

There are two ways to install Trident Sandbox and both offer advantages over the other so you may want both:
(1) Run off Local Filesystem. For this method, you can just download the attached zip, then right click on it and choose properties and unblock it. Then extract it... when its done you can double click the TridentSandbox.htm file or drag and drop the .htm file onto your desktop Internet Explorer and then make it a favorite. Running off local filesystem you have the ability to make web requests to the internet to grab data.
(2) AppCache install. For this method you just visit this page : http://www.obeliskos.com/TridentSandbox . Wait until the AppCache status changes from 'Downloading' to 'Idle' and then the site will continue to run this 'cached' version indefinitely (even if you have no internet connectivity). Running using this method you cannot make internet request but you can use LocalStorage and IndexedDB... two very useful storage mechanisms.

There is a workaround for making ajax requests using the AppCached install, which may or may not be appropriate for your particular concerns. It is described in the 'Making Data Requests in Hosted/AppCached environment' section of this help page : http://www.obeliskos.com/TridentSand...ndAppCache.htm

Upgrading an AppCache version :
If you already have an AppCache for an older version of TridentSandbox, you can upgrade to the latest version using either of the following two methods. (1) go into internet options/settings/caches and databases and delete the old obeliskos.com entry, then revisit the site at link below. If you want to preserve the data you have stored in the TridentDB/IndexedDB, you can visit the site using the desktop Internet Explorer and it will show 'Downloading' and then 'Update Ready', then press F12. This brings up the developer's tools from which you go to the console and type applicationCache.swapCache() and then reload the page... you should be updated.

Additionally (for users of my AppCache site) : When using an appcache website while online it will check for updates by downloading the appcache.mf manifest file... if that file does not exist and the response code is something like file not found, then the appcache will be invalidated. So if you expect/want the appcache site to work even after I may have taken the site down (which I have no intention of doing anytime soon), then you might want to host block the site in your windows hosts file. I believe it would run forever in that mode with no online dependencies (or updates). If you see I have created a new update, you can unblock it to update. The version which is downloaded and run from local filesystem has no such dependencies so this does not apply to the zip download install.

There are also now a few keyboard shortcuts usable within editor controls :
Alt+Q : Toggle Markup Maximize
Alt+W : Toggle Script Maximize
Alt+R : Run Program
Alt+S : Save (File API)
Alt+I : Inspect highlighted object

Hosting your own TridentSandbox Server :
You don't need to do this since I offer my own webserver, but if you want to can can host TridentSandbox on your own website. If you just want to host the files on a server of your own and do not need appcache functionality, then edit the TridentSandbox.htm main page and find (near the beginning of the file) the HTML tag and remove the reference to appcache.mf. If you want to use appcache, then leave the html tag at its default. You might need to register mime types for .mf files (text/cache-manifest) and .prg files (application/json). The newly added Awesome Fonts library may also need mime types configured for a few fonts, you can either add these mime types or remove them from the appcache.mf file (and lose offline support for those). You should be able to use F12 on the desktop IE and monitor the Debugger window as it downloads the appcache and if it fails it will usually tell you the file it had trouble with.

Within TridentSandbox, there are Help pages which provide much better overall information.

TridentSandbox comes with some third party javascript libraries which are made available for you to use in your own scripts.... these include jQuery, jQuery-UI, alertify, jqPlot, jqGrid, fullcalendar, dynatree, highcharts, CryptoJS, Loki.JS (simple JSON object database), Metro.JS, Springy, FontAwesome, Pixi.js, EaselJS, Mathjs. It's structured into a file system hierarchy so you can add your own libraries (local filesystem version only) and register them with the main webpage if you want to extend the environment.

To install local filesystem version :
- Download TridentSandbox.zip to an area like your Documents or Downloads folder.
- IMPORTANT : If you are on Windows RT, Windows 8 or 8.1, right click on the downloaded zip file and choose properties... it may say the file came from the web and give you an option to unblock it... unblock it. Then extract it. If you already extracted it you can right click on the TridentSandbox.htm file choose properties and it will have same option to unblock it... so unblock it.
- Go into the newly extracted directory and run TridentSandbox.htm (it will run in either metro or desktop ie, but I prefer desktop ie, which in that case you might need to drag and drop the htm file onto desktop ie program to load (then bookmark).
- If it asks you to enable scripts, choose yes
- You can load samples which are located in the samples subfolder.
- You can save samples into that folder as well as anywhere else... like SkyDrive. Files manually loaded and saved can be located anywhere but assets referenced as urls within your programs need to be in folder hierarchy (at or below the Trident Sandbox web page you loaded).
Attached Files
File Type: zip TridentSandbox_1.88.zip - [Click for QR Code] (4.77 MB, 3 views)
The Following 3 Users Say Thank You to nazoraios For This Useful Post: [ Click to Expand ]
 
LolitaPlus
Old
#2  
Member
Thanks Meter 9
Posts: 51
Join Date: Oct 2013
Now something really interesting is coming...
 
nazoraios
Old
(Last edited by nazoraios; 15th March 2014 at 10:18 PM.)
#3  
Junior Member - OP
Thanks Meter 8
Posts: 28
Join Date: Jun 2013
deleted
 
nazoraios
Old
(Last edited by nazoraios; 15th March 2014 at 10:18 PM.)
#4  
Junior Member - OP
Thanks Meter 8
Posts: 28
Join Date: Jun 2013
deleted
 
nazoraios
Old
#5  
Junior Member - OP
Thanks Meter 8
Posts: 28
Join Date: Jun 2013
I updated to version 1.6 which you can either download or run from my hosted AppCache version. This appcache version will download all files to allow you to run offline. Running this appcache version will let you use local storage and indexeddb as well as some other options.

See first post for link to AppCache version or download attachment for local filesystem (or both).

Help system also covers this in detail.
 
nazoraios
Old
#6  
Junior Member - OP
Thanks Meter 8
Posts: 28
Join Date: Jun 2013
As far as on-device, in-browser scripting environment for Surface/Windows RT, I consider the latest 1.76 version to be 'Done'. I have opened up a github site where I will host future development at :
https://github.com/obeliskos/TridentSandbox

I will continue to run my AppCache site at http://obeliskos.com/TridentSandbox/ and keep it updated since that is the primary method of distribution still... but at github you can download ZIP of source tree (unblock zip if on Windows 8/8/1/RT), extract, and use the same way as the zip download hosted here.

If you want to contribute to development or make change request you can do that at the github site.

I'll still be around here waiting for announcements by netham
The Following User Says Thank You to nazoraios For This Useful Post: [ Click to Expand ]
 
bridgeofstraws
Old
#7  
Junior Member
Thanks Meter 1
Posts: 17
Join Date: Apr 2014
I was trying Trident on my Surface (which is very cool and useful by the way) and I found that Windows RT (not RT 8.1) doesn't have WebGL support so the 3D demos didn't work. This is supposed to be a limitation of IE 10 which comes with the surface. IE 11 which comes with Windows RT 8.1. I was wondering if anyone knows what files I should copy from a WIndows RT 8.1 tablet to get the files necessary for IE 11 to work with WebGl.

Everything else works so well.
 
nazoraios
Old
(Last edited by nazoraios; 28th April 2014 at 11:27 PM.)
#8  
Junior Member - OP
Thanks Meter 8
Posts: 28
Join Date: Jun 2013
Yep that was a new feature Microsoft added for Windows 8.1 (and updated for more complete implementation in 8.1 update 1). For what its worth my Surface 1 upgraded to 8.1 runs the opengl demos fine... so once jb for 8.1 comes out it should upgrade to full functionality. I'll probably put a notice in those samples if I detect rt 8.0.

I do not know about which files are needed, sorry... you might need updated video drivers too.

On an unrelated note, I just discovered that the AppCache version CAN do internet ajax requests. You can go into Tools/Internet Options/Security/Custom Level... and scroll down to the 'Miscellaneous' section and the first 'Access data sources across domains' setting to Enable. You should then be able to make your ajax calls assuming the website allows requests from outside its own domain. Not sure if there is any reason why you would want to leave this disabled, if you are worried you might try the prompt setting to approve requests... most times this is enforced at the web server level. I'm pretty sure the same workaround applies to IE 10 but I can't test that.

So while I am pretty much feature complete on the local filesystem version, I will probably continue to update my AppCache site (and github) with new features in the future. I will probably update the file hosted here to a 1.82 version with updated help system and samples to clear this up in a few days... after that I will probably just update the github site (with its zip download).
 
GoodDayToDie
Old
#9  
Recognized Developer
Thanks Meter 2645
Posts: 5,539
Join Date: Jan 2011
Location: Seattle
The reason for "Access data sources across domains" usually being restricted is that sites which aren't explicitly configured for safe CORS (Cross-Origin Resource Sharing) may leak information to an attacking website (things like authentication credentials, for example) if the browser doesn't check to ensure CORS is safe before sending the request. Basically, it breaks the same-origin policy which protects sites from one another. If you're signed into A.com and visit B.com, and B.com wants to get resources from A.com, the browser usually first checks with A.com to see if this is permitted. Disabling that check is very dangerous.
Win8/Windows RT projects:
List of desktop apps for hacked RT devices

WP8 projects:
Native Access WebServer and Libraries
WP8 Interop Unlocks
Storage Cleanup tool

WP7 projects:
XapHandler, Root Webserver, OEM Marketplace XAPs, Bookmarklets collection (Find On Page), Interop-unlock hacks.


Do not private message me with questions that should have been posted on the forum! Not only are you wasting your time - I'm not going to bother writing an answer to such a question for only one person - but I will probably block you from PMing me in the future as well.
 
nazoraios
Old
(Last edited by nazoraios; 1st May 2014 at 10:33 PM.)
#10  
Junior Member - OP
Thanks Meter 8
Posts: 28
Join Date: Jun 2013
That sounds like good advice...

This is the guidance I have put in the help pages starting in version 1.82 :

Making Data Requests in Hosted/AppCached environment : By default, you can only make AJAX calls to websites to get data when you are running off of your local filesystem (zip file distribution). If you are running Hosted or AppCached, this ability to make AJAX requests is disabled by default. There is a workaround (which I will describe here) that may or may not be appropriate depending on how you use it. In Internet Explorer, if you go into Tools/Internet Options/Security, you have Zones like 'Internet', 'Trusted', 'Restricted', 'Intranet'. If you do not currently have sites in the 'Trusted' Zone, then you can add the Trident Sandbox AppCache domain (http://www.obeliskos.com) to that zone. In order to do that you will have to disable the checkbox 'Require server verification (https for all sites in this zone' since my AppCache site does not support SSL. Now, if the 'Trusted' Zone is highlighted click on 'Custom level...', scroll down to the 'Miscellaneous' section and set the 'Access data sources across domains' option to 'Enable' for your data requests to work. It is important to not to apply this setting to the 'Internet' Zone for security purposes that would open this feature to pretty much every site you visit. If you already have sites in your 'Trusted' zone you probably don't want to do this, and you should just do this temporarily when you need internet access not as a permanent policy. Do not visit any untrusted sites while the setting is active. When you are done you can re-apply the https: required checkbox and set the 'Access data sources across domains' back to disabled. If you host Trident Sandbox yourself on a server with https enabled and your site was the only site in the Trusted zone, then you could safely leave it enabled all of the time. That said, and all warnings duly noted, this workaround opens the possibly of implementing all sorts of creations which require internet ajax web requests -and- data storage capabilities.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...