Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

spec_runner.html: allow to specify require_config.js (by URL parameter) #9

Closed
x1B opened this issue Jul 16, 2015 · 3 comments
Closed

Comments

@x1B
Copy link
Member

x1B commented Jul 16, 2015

For testing widgets independent of their install-location, we'd like to help the user to specify the location of the require_config.js without modifying the spec_runner.html.

This could be implemented through a URL parameter, but we need to make sure that this parameter cannot be abused to execute arbitrary scripts under the origin of the spec-runner's site.

For example, we could allow only a number of levels to go up (-1 might go straight to the root).

@x1B x1B self-assigned this Jul 16, 2015
@x1B x1B added in progress and removed assigned labels Jul 20, 2015
@x1B
Copy link
Member Author

x1B commented Jul 20, 2015

To stay safe, we can allow to specify a numeric depth level.
The level is used to look up the require_config.js relative to the location of the spec_runner.html. The default would be 4 (../../../../require_config.js).

@x1B
Copy link
Member Author

x1B commented Jul 20, 2015

depth -> folderDepth

x1B added a commit that referenced this issue Jul 20, 2015
* feature/9-allow-to-move-spec-runner:
  (#9) example: spec-runner now takes URL parameter for config-lookup
@x1B
Copy link
Member Author

x1B commented Jul 20, 2015

Implemented on master (v0.4.0).

Upgrade Information

The example HTML spec-runner (for browser-use only) now allows to specify where to look for the require_config.js.

By default, the configuration will be searched as if the spec-runner was used by a widget installed under includes/widgets/{category}/{widget-name}. To use a different location, pass the URL parameter folderDepth={x} to the spec-runner, where x is the number of URL segment to go upwards for finding the require_config.js.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants