File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
var gamejs = require ( 'gamejs' ) ;
2
+ var uri = require ( 'gamejs/utils/uri' ) ;
2
3
3
4
/**
4
5
* @fileoverview
@@ -98,10 +99,7 @@ var workerPrefix = function workerPrefix() {
98
99
* @ignore
99
100
**/
100
101
var create = function ( workerModuleId ) {
101
- // FIXME depends on 'index.html'
102
- var idx = document . location . href . indexOf ( 'index.html' ) ;
103
- var docLoc = idx > - 1 ? document . location . href . substr ( 0 , idx ) : document . location . href ;
104
- var moduleRoot = docLoc + window . require . getModuleRoot ( ) ;
102
+ var moduleRoot = uri . resolve ( document . location . href , window . require . getModuleRoot ( ) ) ;
105
103
var initialScripts = [ ] ;
106
104
Array . prototype . slice . apply ( document . getElementsByTagName ( 'script' ) , [ 0 ] ) . forEach ( function ( script ) {
107
105
if ( script . src ) {
@@ -135,7 +133,7 @@ var create = function(workerModuleId) {
135
133
* GameJs modules.
136
134
*
137
135
* **Note:** A Worker does not have access to the browser's `document`. So
138
- * a lot of GameJs modules - everything related to drawing to the canvas -
136
+ * a lot of GameJs modules - everything related to drawing to the canvas -
139
137
* do not work in the Worker.
140
138
*
141
139
* You can use `gamejs.time.*`, `gamejs.utils.*`, `gamejs.event.*` and probably others
You can’t perform that action at this time.
0 commit comments