aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-12-19 18:10:29 +0200
committerJukka Jylänki <jujjyl@gmail.com>2013-12-19 18:10:29 +0200
commite98f5e310df4e255fc08213865f1cbd8e4d75d89 (patch)
tree6f52cb8c4679959b60c7ae204f4b5dcfb258a84c /src
parent68bc17077e0919d369fe898631f7a2108487534a (diff)
Implement command line passing to work to emrun when --emrun is passed.
Diffstat (limited to 'src')
-rw-r--r--src/emrun_prejs.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/emrun_prejs.js b/src/emrun_prejs.js
new file mode 100644
index 00000000..14613c5d
--- /dev/null
+++ b/src/emrun_prejs.js
@@ -0,0 +1,5 @@
+// Route URL GET parameters to argc+argv
+Module['arguments'] = window.location.search.substr(1).trim().split('&');
+// If no args were passed arguments = [''], in which case kill the single empty string.
+if (!Module['arguments'][0])
+ Module['arguments'] = [];