diff --git a/ursh/indico_ursh/client/index.js b/ursh/indico_ursh/client/index.js index 495c1ba..05b4b0d 100644 --- a/ursh/indico_ursh/client/index.js +++ b/ursh/indico_ursh/client/index.js @@ -15,6 +15,7 @@ * along with Indico; if not, see . */ +import 'url-polyfill'; import {handleAxiosError, indicoAxios} from 'indico/utils/axios'; @@ -41,8 +42,8 @@ function _validateAndFormatURL(url) { } // if protocol is missing, prepend it - if (url.startsWith(window.location.hostname)) { - url = `${window.location.protocol}//${url}`; + if (url.startsWith(location.hostname)) { + url = `${location.protocol}//${url}`; } let parsedURL; diff --git a/ursh/package.json b/ursh/package.json new file mode 100644 index 0000000..68e321b --- /dev/null +++ b/ursh/package.json @@ -0,0 +1,19 @@ +{ + "name": "indico-plugin-ursh", + "version": "1.0.0", + "description": "URL shortening service provider for Indico", + "main": "indico_ursh/client/index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/indico/indico-plugins.git" + }, + "author": "Indico Team ", + "license": "GPL-3.0", + "bugs": { + "url": "https://github.com/indico/indico-plugins/issues" + }, + "homepage": "https://github.com/indico/indico-plugins#readme", + "dependencies": { + "url-polyfill": "^1.1.0" + } +}