Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b5f1b89
working webview inside our own webserver extension
alexquintero Apr 26, 2016
fafbe32
remove unnecessary files for us
alexquintero Apr 27, 2016
008de53
removed more files we don't need and used the normal webgl app's temp…
alexquintero Apr 27, 2016
9c420f3
use the compressed javascript files instead
alexquintero Apr 28, 2016
7f5733e
Increasing buffer sizes to improve loading times
pcram Apr 28, 2016
b46037e
ignores the IL folder
alexquintero Jun 6, 2016
db5d7cc
adds kiosk mode
alexquintero Jun 6, 2016
0fe0f7b
Update README.md
alexquintero Jun 6, 2016
f14b024
removes some unnecessary permissions form the manifest file
alexquintero Jun 6, 2016
4d3fb59
adds the ability to read messages sent by the webview
alexquintero Jun 10, 2016
d2eab26
Added files for spanish build
rwolkins Jun 16, 2016
8e1be0a
had to remove the ñ powershell didn't like it
rwolkins Jun 16, 2016
4f7bbcf
Cleaned Up Manifest requested by Sean
rwolkins Jun 21, 2016
5127c2e
fixed bug where specialized Spanish characters were not liked in a path
rwolkins Jun 27, 2016
1b07711
new package icons
rwolkins Jun 30, 2016
b9559cd
adds adaptive streaming to the settings that can be set inside the ch…
alexquintero Aug 5, 2016
3733ed4
Merge branch 'master' into IL, update handlers.js to use DOMError ins…
Aug 24, 2016
eb9eb7c
Change dash.mediaplayer.min.js to download the compressed version
rwolkins Sep 7, 2016
05060e2
fix for adaptive streaming setting
adamjchristiansen Nov 21, 2016
45863a4
IL-14244 - when the chome app is installed whenever a user goes to ht…
rwolkins Dec 15, 2016
f2092f3
IL-14224 - fix a syntax problem in the manifest.json
rwolkins Dec 19, 2016
0f1aac3
change the url_handler to il-client-dev.azurewebsites.net for testing.
rwolkins Dec 20, 2016
1f334a2
IL-14244 - rollback and revisit in the up coming sprint
rwolkins Dec 21, 2016
911add5
IL-14244 - url override to open the chrome app when installed
rwolkins Jan 3, 2017
edd1bf5
IL-14244 - opps forgot coma
rwolkins Jan 3, 2017
cac1bfc
IL-14244 - only redirect client.imaginelearning.com
rwolkins Jan 9, 2017
6975ea7
IL-15906: Get URL of launching page so parameters can be passed to pa…
Mar 21, 2017
00798ad
IL-15906: Added URL handlers for all environments.
Mar 21, 2017
07e300a
Merge pull request #1 from ImagineLearning/IL-15906
ericgibby Mar 22, 2017
ebd4cb8
IL-15906: Fixed misspelling of "chrome"
Mar 22, 2017
31000df
IL-15906: Updated URL handlers to only trigger on WebGL client sites
Mar 22, 2017
6f8e5b6
add new image and manifest.json for Imagine Language and Literacy
adamjchristiansen Jul 21, 2017
9000b8e
add query param for environment
adamjchristiansen Jul 27, 2017
90ca459
Merge pull request #2 from ImagineLearning/EnvQueryParam
adamjchristiansen Jul 27, 2017
4bc2ed8
removing power settings and setting default environment to production…
adamjchristiansen Jul 27, 2017
d0ca78c
Update manifest_unityclient.json
lincolncoe Jul 31, 2017
e7edd82
IL-24401: Added handler so webview can use `chrome.runtime.sendMessag…
ericgibby Aug 22, 2017
396874b
get the serversettings from managed storage, not local storage
alexquintero Aug 29, 2017
b79dfa5
IL-24520: Fixed `convertServerSettingsToUrl` to properly add sitecode…
Aug 29, 2017
d0df711
IL-24552 Lowering the minimum version to allow our error to appear (#6)
lincolncoe Sep 5, 2017
cbd0891
Add URL Handlers to auto launch (#7)
lincolncoe Oct 16, 2017
33c1545
Fixing a comma to make it valid JSON
lincolncoe Oct 17, 2017
e495983
Removing EAP and Partner URL's
lincolncoe Mar 9, 2018
f863927
Only allow 1 app instance open (#8)
lincolncoe Apr 4, 2018
a899d1c
Removing App ID until we can handle SSO
lincolncoe Apr 5, 2018
2c28fcb
Merge pull request #9 from ImagineLearning/remove-app-id
Apr 5, 2018
c16fd8d
Adding the app ID again to prevent multiple launches (#10)
lincolncoe Apr 26, 2018
d2fb1a8
APP-7855 Remove Power Permission (#11)
lincolncoe May 7, 2018
ed18231
rebrand to Imagine Learning Student (#12)
lincolncoe Jul 30, 2018
34ba0e1
Add videoCapture Permissions
Aug 23, 2018
8a21103
Merge pull request #13 from ImagineLearning/add-webcam-capture-permis…
Aug 27, 2018
14ffe28
Updating URL handlers for chrome update (#14)
lincolncoe Feb 6, 2019
b889383
Making changes to not crash on a redirect and to capture all traffic …
dseabolt Sep 10, 2019
eb34561
Removing multi-domain support
dseabolt Sep 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
## Picked and pieced from here: https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# Don't want any of our prebuilt files getting checked in
IL/

129 changes: 20 additions & 109 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,119 +1,30 @@
<a target="_blank" href="https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb">![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-app-samples/master/tryitnowbutton.png "Click here to install this sample from the Chrome Web Store")</a>

# Chrome Web Server - an HTTP web server for Chrome (chrome.sockets)

Get it in the chrome web store:
https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb

Many people have found the webstore version useful for doing some basic web development as an alternative to python -m SimpleHTTPServer. But it can also be used for quick file sharing over a local network.

Features
- serve local files
- configure listening port
- configure listening interface (e.g. localhost or all interfaces)
- custom http handlers possible
- websocket support available
- works nice with chrome.runtime.onSuspend
- options for autostart, start in background, etc etc.
- handles range requests, HEAD, etc
- options for CORS
- optional PUT, DELETE request (for upload files)
- sets MIME types
- can render directory listing
- See relevant options: https://github.com/kzahel/web-server-chrome/blob/master/polymer-ui/options.js


How to include into your own chrome app
===

run minimize.sh to concatenate all the required files together and then include the resulting wsc-chrome.min.js in your project. Here is an example of another project's usage: https://github.com/zebradog/kiosk/blob/f7a398f697edc1c22b90c14f959779f1e850012a/src/js/main.js#L124

This is based on an existing extension in the web store called Chrome Web Server
===
Basic usage:

```
var app = new WSC.WebApplication(options)
app.start( callback )
```

options: object, with keys
- handlers: array of handlers,
- renderIndex: boolean (whether to render index.html if in directory)
- optBackground: whether to run even if the window is closed
- optAutoStart: whether to auto start when chrome starts
- port: int (port to listen on)
- See relevant options: https://github.com/kzahel/web-server-chrome/blob/master/polymer-ui/options.js

```
Handlers
var handlers = [
['/favicon.ico',FavIconHandler],
['/stream.*',StreamHandler],
['/static/(.*)',StaticHandler],
['.*', DefaultHandler]
]
```

handlers is an array of 2 element arrays where the first item is a regular expression for the URL and the second is the handler class, which should extend WSC.BaseHandler

```
function StaticHandler() {
this.disk = null
chrome.runtime.getPackageDirectoryEntry( function(entry) { this.disk = entry }.bind(this) )
WSC.BaseHandler.prototype.constructor.call(this)
}
var FavIconHandlerprototype = {
get: function(path) {
// USE HTML5 filesystem operations to read file

},
onReadFile: function(evt) {
if (evt.error) {
this.write('disk access error')
} else {
this.write(evt)
}
}
}
_.extend(StaticHandler.prototype,
StaticHandlerprototype,
WSC.BaseHandler.prototype
)
```


====
Building
====
Unfortunately there is a build process if you want to run this from source directly because I am using a Polymer (polymer-project.org) user interface. There is a bower.json in the polymer-ui folder and you will need to install node+npm+bower and then run bower install from that folder. Oh, and then you will need to "Refactor for CSP" (chrome apps do not allow inline scripts), one way of doing this is using https://chrome.google.com/webstore/detail/chrome-dev-editor-develop/pnoffddplpippgcfjdhbmhkofpnaalpg (open the folder and right click and select refactor for CSP)

I'm now using a script that can do this (look in polymer-ui/build.sh. You'll need to npm install -g vulcanize crisper)

====

Get it in the chrome web store:
https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb

The default behavior right now is very simple. You choose a directory
to serve static content. It is now able to stream large files and
handle range requests. It also sets mime types correctly.

Here is an example project based on it:
https://chrome.google.com/webstore/detail/flv-player/dhogabmliblgpadclikpkjfnnipeebjm

====
https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb

MIT license
==
General modifications made
==

I wrote this because the example app provided by google would lock and
hang and had all sorts of nasty race conditions. Plus it would not
stream large files or do range requests, HEAD requests, etc, etc.
* No static directory or configuration required because we server up IL's WebGL build from the IL folder directly
* The buffer sizes increased to server our pages up quicker
* We force the app to server the jsgz files to make it transfer less data
* Manifest modified to accomodate recordings

The design of this is inspired heavily by to the Python Tornado Web
library. In this as well as that, you create an "app" which registers
handlers. Then under the hood it will accept connections, create an
HTTPConnection object, and that has an associated IOStream object
which handles the nonblocking read/write events for you.
==
Build instructions
==

To make something that can go to the Chrome Web Store is pretty simple but here are the steps:

See CREDITS file
* Copy the WebGL build from Q:\Tablet\PotentialRelease\Sprint##\1.##.#####\bin into the IL folder
* Open the uniquely named folder and delete the release directory (files aren't used)
* Open the templatedata directory and rename Booster.png to booster.png
* In the compressed directory you can delete WebGL.jsgz since it isn't used (10 mb-ish)
* Open the manifest.json from the root and update the version number to match whatever you've just added

At that point you can send the package to the Chrome Web Store
2 changes: 0 additions & 2 deletions TODO

This file was deleted.

Loading