Skip to content

Commit

Permalink
Merge pull request #10 from wsg-ariadne/alpha-testing
Browse files Browse the repository at this point in the history
Prep for alpha testing
  • Loading branch information
jareddantis committed Apr 21, 2023
2 parents fda9eb5 + a8cedab commit 9900363
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 22 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=http://localhost:5000
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=https://ariadne.dantis.me
3 changes: 1 addition & 2 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
- name: Build extension (Manifest V2)
Expand All @@ -29,5 +29,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "web-ext-artifacts/*.zip"
tags: true
if: github.event_name != 'pull_request'
15 changes: 3 additions & 12 deletions background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,15 @@ class AriadneBackground {
constructor() {
this._tabStates = [];
this._reportStats = {};
this._API_URL = 'https://ariadne.dantis.me/api/v1';

// Determine if running in unpacked mode
const that = this;
browser.management.get(browser.runtime.id)
.then((extensionInfo) => {
if (extensionInfo.installType === 'development') {
console.log('[bg] Running in development mode');
that._API_URL = 'http://localhost:5000/api/v1';
}
that.addListeners();
});
this._API_URL = import.meta.env.VITE_API_URL + '/api/v1';

// Alias if browser.action is defined, i.e. in Manifest V3
this.BrowserAction = browser.browserAction;
if (browser.action !== undefined) {
this.BrowserAction = browser.action;
}

this.addListeners();
}

addListeners() {
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
"url": "https://github.com/wsg-ariadne/ariadne"
},
"scripts": {
"dev": "vite",
"dev:bg": "vite build -m development --config vite.bg.config.js",
"dev:content": "vite build -m development --config vite.content.config.js",
"dev:main": "vite build -m development",
"dev": "for TARGET in main bg content; do npm run dev:$TARGET; done",
"dev:v3": "npm run dev && mv dist/manifest.v3.json dist/manifest.json",
"build:bg": "vite build --config vite.bg.config.js",
"build:content": "vite build --config vite.content.config.js",
"build:main": "vite build",
"build": "for TARGET in main bg content; do NODE_ENV=production npm run build:$TARGET; done",
"build:v3": "npm run build && mv dist/manifest.v3.json dist/manifest.json",
"package": "npm run build && web-ext build --overwrite-dest --source-dir dist --ignore-files \"**/manifest.v3.json\"",
"package:v3": "npm run build:v3 && web-ext build --overwrite-dest --source-dir dist"
"package": "npm run build && mv dist/manifest.v3.json dist/manifest.json && web-ext build --overwrite-dest --source-dir dist --ignore-files \"**/manifest.v3.json\"",
"package:v3": "npm run build && web-ext build --overwrite-dest --source-dir dist"
},
"dependencies": {
"@heroicons/vue": "^2.0.16",
Expand Down
3 changes: 1 addition & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"manifest_version": 2,
"default_locale": "en",
"permissions": [
"tabs",
"management"
"tabs"
],
"optional_permissions": [
"<all_urls>"
Expand Down
3 changes: 1 addition & 2 deletions public/manifest.v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"default_locale": "en",
"minimum_chrome_version": "88",
"permissions": [
"tabs",
"management"
"tabs"
],
"icons": {
"128": "assets/img/Button@8x.png"
Expand Down

0 comments on commit 9900363

Please sign in to comment.