Commit 929b8c7c authored by Saul Shanabrook's avatar Saul Shanabrook

Add web extension polyfill for chrome

parent c295b4c9
......@@ -10,7 +10,12 @@
"assets": [
"assets",
"manifest.json",
"favicon.ico"
"favicon.ico",
{
"glob": "browser-polyfill.min.js",
"input": "../node_modules/webextension-polyfill/dist/browser-polyfill.min.js",
"output": "."
}
],
"index": "index.html",
"main": "main.ts",
......
......@@ -91,3 +91,7 @@ src/app/**/*.js.map
# delete #
/src/app/oldlist
dist.zip
web-ext-artifacts
archive.zip
\ No newline at end of file
......@@ -22,6 +22,14 @@ lint:
script:
- yarn run lint
lint-ext:
stage: test
dependencies:
- yarn_install
script:
- yarn run build:ext
- yarn run lint:ext
test:
stage: test
dependencies:
......
......@@ -77,7 +77,7 @@ Then we'll run web-ext to launch the code as an extension in Firefox.
1. Run backend either in docker or hosted service
2. Ensure yarn, node 6+, and [web-ext ](https://www.npmjs.com/package/web-ext) are installed
3. `yarn install` (if not done already)
4. `yarn run build -- --aot=true --env=extension --watch`
4. `yarn run build:ext -- --watch`
5. (new term) `web-ext run -s dist/ -a dist/
This process can be a little slow. You are encouraged to use test driven development or working on the web front end when possible.
......@@ -91,6 +91,51 @@ If you'd like to try the extension in Chrome:
3. Check the "Developer Mode" box up top if you haven't already done so.
4. Click "Load unpacked extension..." and select the `dist/` folder.
## Deploying extension
First build the extension:
```bash
yarn run build:ext
```
Then make sure it passes the linter:
```bash
yarn run lint:ext
```
Then we wanna zip it up:
```bash
./node_modules/.bin/web-ext build -s dist/ -a dist/ -i "*.map"
```
Then we can upload the zip it gives us to the Chrome or Firefox store.
For Firefox, they also want a zip of the source code so they can build it.
Create this with (after commiting changes):
```bash
git archive --format=zip -o archive.zip HEAD
```
Then, when uploading, in the "Notes to Reviewer" write:
> To install run:
>
> yarn install
>
> yarn run build:ext
>
> ./node_modules/.bin/web-ext build -s dist/ -a dist/ -i “*.map”
>
> Click register and for the server use “demo.passt.io”.
>
> We had to enable unsafe eval for the core angular libraries and for angular cli with webpack <https://github.com/angular/angular-cli/issues/3430>.
>
> All software versions are available in the yarn.lock file
# Mobile app
We use NativeScript for the modile app. At this time it's not read to use.
......
......@@ -6,8 +6,10 @@
"ng": "ng",
"start": "ng serve --host 0.0.0.0",
"build": "ng build",
"build:ext": "ng build --aot=true --env=extension",
"test": "ng test",
"lint": "ng lint",
"lint:ext": "web-ext -s dist/ lint",
"e2e": "ng e2e",
"cie2e": "export DISPLAY=:99.0; ./xvfb.sh start; sleep 2; yarn run webdriver-manager -- update --standalone false --gecko false; ng e2e --webdriver-update false"
},
......@@ -49,6 +51,7 @@
"susy": "^2.2.12",
"url-parse": "^1.1.8",
"web-ext": "^1.9.1",
"webextension-polyfill": "^0.1.1",
"zone.js": "^0.8.4"
},
"devDependencies": {
......
......@@ -5,12 +5,12 @@
// https://www.paulirish.com/2012/box-sizing-border-box-ftw/
html {
box-sizing: border-box;
font-family: 'Overpass', Arial, Helvetica, sans-serif;
box-sizing: border-box !important;
font-family: 'Overpass', Arial, Helvetica, sans-serif !important;
}
*, *:before, *:after {
box-sizing: inherit;
font-family: inherit;
box-sizing: inherit !important;
font-family: inherit !important;
}
@import '../assets/scss/layouts';
......@@ -30,5 +30,5 @@ input,
optgroup,
select,
textarea {
font-family: 'Overpass', Arial, Helvetica, sans-serif;
font-family: 'Overpass', Arial, Helvetica, sans-serif !important;
}
......@@ -15,6 +15,7 @@
<meta name="application-name" content="Passit">
<meta name="msapplication-config" content="assets/icon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<script type="application/javascript" src="browser-polyfill.min.js"></script>
</head>
<base href="/">
<body>
......
......@@ -28,5 +28,6 @@
},
"name": "Passit",
"manifest_version": 2,
"version": "0.1.0"
"version": "0.1.4",
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
}
......@@ -1999,9 +1999,9 @@ [email protected]^3.6.0:
esrecurse "^4.1.0"
estraverse "^4.1.1"
"[email protected]:entequak/eslint-plugin-no-unsafe-innerhtml#4b6b606d50":
[email protected]/eslint-plugin-no-unsafe-innerhtml#4b6b606d50:
version "1.0.15"
resolved "https://codeload.github.com/entequak/eslint-plugin-no-unsafe-innerhtml/tar.gz/4b6b606d50"
resolved "https://codeload.github.com/EnTeQuAk/eslint-plugin-no-unsafe-innerhtml/tar.gz/4b6b606d50"
dependencies:
eslint "^3.7.1"
......@@ -6649,6 +6649,10 @@ [email protected]^12.0.6:
semver "^5.3.0"
xml2js "^0.4.17"
[email protected]^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.1.1.tgz#1d172e59b9ee8706d5ce2c55eebfe0cf23972d70"
[email protected]^1.10.2:
version "1.10.2"
resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.10.2.tgz#2e252ce1dfb020dbda1ccb37df26f30ab014dbd1"
......@@ -6822,20 +6826,13 @@ [email protected]^0.2.1:
dependencies:
mkdirp "^0.5.1"
[email protected]:
[email protected], [email protected]^1.0.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.1.tgz#082ddb6c641e85d4bb451f03d52f06eabdb1f018"
dependencies:
options ">=0.0.5"
ultron "1.0.x"
[email protected]^1.0.1:
version "1.1.4"
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.4.tgz#57f40d036832e5f5055662a397c4de76ed66bf61"
dependencies:
options ">=0.0.5"
ultron "1.0.x"
[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wtf-8/-/wtf-8-1.0.0.tgz#392d8ba2d0f1c34d1ee2d630f15d0efb68e1048a"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment