[Windows RT Development and Hacking] nazoraios:
View 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 browser-app development environment which runs within a browser itself. It was originally intended to fill a void in the Windows RT app development ecosystem. 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.

It now supports WinJS 4.0 library, supports linting, code completion, backup and restore and the sandbox api has been reorganized into a namespace-like hierarchy you can traverse with code completion or view an api reference with a keyboard shortcut. Keyboard shortcuts are now rebindable, and for users running directly off their device I now support an in-memory database adapter where you can set up an elaborate database of saves, script and markup units, and data to be backed up and restored as a single file.

All you have to do to install this native web app is visit this web site :

http://www.obeliskos.com/TridentSandbox

This project is hosted on GitHub at :

https://github.com/obeliskos/TridentSandbox

Trident Sandbox now supports the Microsoft WinJS 4.0 framework which used to be intended for JavaScript Windows Store Apps, but now work outside the appstore, in the browser, and are cross-browser compliant. WinJS allows for browser apps which behave like native apps. For more information on the WinJS framework go here : http://dev.windows.com/en-us/develop/winjs.

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/TridentSandbox/docs/HostingAndAppCache.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.

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).

Downloads (If you prefer to download and run off your device or server) are now available here :

https://github.com/obeliskos/TridentSandbox/releases