Skip to content

Commit a276d0e

Browse files
committed
5.0.0
1 parent 2183788 commit a276d0e

File tree

14 files changed

+104
-21
lines changed

14 files changed

+104
-21
lines changed

.DS_Store

0 Bytes
Binary file not shown.

._readme/.DS_Store

2 KB
Binary file not shown.

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
3030

3131
---
3232

33+
## Store links:
34+
- [Chrome Web Store](https://chromewebstore.google.com/detail/mist-extension/ejhpdcljeamillfhdihkkmoakanpbplh)
35+
36+
3337
## Features
3438

3539
### Supported Juniper Clouds
@@ -141,9 +145,9 @@ This extension is not yet available on the [Chrome Web Store](https://chrome.goo
141145
## Build Instructions
142146

143147
This extension was developed on macOS 12.6.1 using:
144-
- Node.js 19.0.1
145-
- npm 8.19.2
146-
- Python 3.8.5
148+
- Node.js >= 19.0.1
149+
- npm >= 8.19.2
150+
- Python >= 3.8.5
147151

148152
### Prerequisites
149153
From the `angular` folder, install dependencies:

angular/package-lock.json

Lines changed: 19 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@angular/platform-browser-dynamic": "^18.2.13",
3737
"@angular/router": "^18.2.13",
3838
"@types/webextension-polyfill": "^0.12.1",
39+
"dompurify": "^3.2.5",
3940
"ngx-build-plus": "^18.0.0",
4041
"rxjs": "^7.8.1",
4142
"tslib": "^2.8.1",

angular/src/app/services/browser.service.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Injectable } from '@angular/core';
22
import { BehaviorSubject } from 'rxjs';
3-
//import browser from "webextension-polyfill";
43
import browser from "webextension-polyfill";
54

65

@@ -167,15 +166,11 @@ export class BrowserService {
167166
}
168167

169168
setStorage(k:string, v:string):void{
170-
browser.storage.local.set({k: v}).then((res)=>{
171-
console.log("Storage: "+k+" saved to "+v)
172-
}).catch(err => console.log(err))
169+
browser.storage.local.set({k: v}).catch(err => console.log(err))
173170
}
174171
getStorage(k:string, cb:(res)=>void) {
175172
browser.storage.local.get({k}).then(
176173
data => {
177-
console.log("Storage: "+k+" was saved to "+data.k)
178-
console.log(data.k)
179174
cb(data.k);
180175
}, err => {
181176
console.log(err)

angular/src/assets/js/id_links.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ browser.storage.local
1313
//if (window.location.host == "api.mist.com") {
1414
const uuid_re = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/
1515
const uuid_re_tail = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
16-
function process_ids() {
1716

17+
function process_ids() {
1818
const domElements = document.getElementsByClassName("response-info")
1919
var domElement, finalElements;
2020
try {
@@ -73,21 +73,23 @@ function process_ids() {
7373
}
7474
}
7575
} catch (e) {
76-
console.warning("Error in process_ids: ", e);
76+
console.warn("Error in process_ids: ", e);
7777
}
7878
}
7979

8080
function inject_next(finalElements, index, host) {
8181
const next_value = finalElements[index].innerText.replaceAll("\"", "")
8282
const url = "https://" + host + next_value;
83-
finalElements[index].innerHTML = "\"<a href=\"" + url + "\" style=\"text-decoration: underline;color: #D14;\">" + next_value + "</a>\"";
83+
let cleanHTML = DOMPurify.sanitize("\"<a href=\"" + url + "\" style=\"text-decoration: underline;color: #D14;\">" + next_value + "</a>\"");
84+
finalElements[index].innerHTML = cleanHTML;
8485
}
8586

8687
function inject_common_link(finalElements, index, baseUrl) {
8788
const id = get_id(finalElements, index)
8889
const url = get_url(baseUrl, id)
8990
if (url && id) {
90-
finalElements[index].innerHTML = "\"<a href=\"" + url + "\" style=\"text-decoration: underline;color: #D14;\">" + id + "</a>\"";
91+
let cleanHTML = DOMPurify.sanitize("\"<a href=\"" + url + "\" style=\"text-decoration: underline;color: #D14;\">" + id + "</a>\"")
92+
finalElements[index].innerHTML = cleanHTML;
9193
}
9294
return id;
9395
}

angular/src/assets/js/purify.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular/src/assets/js/serviceWorker.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
var browser_name = "ffx";
34
if (typeof browser === "undefined") {
45
var browser = chrome;
@@ -56,3 +57,5 @@ function apiBadge(color) {
5657
browser.action.setBadgeText({ "text": "" });
5758
}
5859
}
60+
61+

angular/src/manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
],
2424
"js": [
2525
"/assets/js/content.js",
26-
"/assets/js/id_links.js"
26+
"/assets/js/id_links.js",
27+
"/assets/js/purify.min.js"
2728
]
2829
}
2930
],

0 commit comments

Comments
 (0)