• Sean Hammond's avatar
    Add hostPageSetting() method (not used yet) · 5a2181e3
    Sean Hammond authored
    Add a new `annotator.config.settingsFrom#hostPageSetting(settingName)`
    method that encapsulates a bunch of logic in one method:
    
    - It always returns null if the client is from a browser extension.
      Browser extensions don't read settings from the host page.
    - If the host page's `window.hypothesisConfig()` function returned a
      value for the requested setting, `hostPageSetting(settingName)` returns
      that value.
    - If `hypothesisConfig()` doesn't return the setting it looks for it in
      `js-hypothesis-config` scripts in the host page
    - If the setting isn't defined in either place it returns `undefined`.
    5a2181e3
Name
Last commit
Last update
.github Loading commit data...
docs Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
gulpfile.js Loading commit data...
package.json Loading commit data...
requirements-dev.in Loading commit data...
yarn.lock Loading commit data...