Skip to content

Commit

Permalink
Merge pull request #563 from privacy-tech-lab/issue-559
Browse files Browse the repository at this point in the history
Issue 559
  • Loading branch information
JoeChampeau authored Mar 15, 2024
2 parents 2b3c335 + d49a748 commit 824001a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/background/analysis/analyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ async function analyze(request, userData) {
const parent = tagParent(reqUrl);

// push the job to the Queue (will add the evidence for one HTTP request at a time)
evidenceQ.push(function (cb) {
evidenceQ.push(async function (cb) {
//@ts-ignore
cb(
undefined,
addToEvidenceStore(
await addToEvidenceStore(
allEvidence,
parent,
rootUrl,
Expand Down
6 changes: 1 addition & 5 deletions src/background/analysis/buildUserData/structuredRoutines.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ export function buildGeneralRegex(genString) {
for (let i = 0; i < genString.length; i++) {
const c = genString.charAt(i);
// add digits regularly
if (
(c >= "0" && c <= "9") ||
(c >= "A" && c <= "Z") ||
(c >= "a" && c <= "z")
) {
if (new RegExp(/[\p{L}\p{N}]/, "u").test(c)){
regexString.push(c);
}
// optional non-digit otherwise
Expand Down
2 changes: 1 addition & 1 deletion src/background/analysis/interactDB/addEvidence.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function updateFetchedDict(evidenceDict, e) {
* @param {string|undefined} parent Parent company of the request Url, if possible
* @param {string} rootU The rootUrl of the request
* @param {string} requestU The requestUrl of the request
* @returns {Promise<string|void>} Side effects only
* @returns {Promise<string>} Side effects only
*
*/

Expand Down
9 changes: 8 additions & 1 deletion src/background/analysis/requestAnalysis/scanHTTP.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ export function getAllEvidenceForRequest(request, userData) {
"requestBody",
"responseData",
]);
request.reqUrl = decodeURI(request.reqUrl);
const decodedStrReq = JSON.stringify(request, [
"reqUrl",
"requestBody",
"responseData",
]);
//console.log(strRequest);

/**
* @type {Evidence[]|any[]}
Expand Down Expand Up @@ -126,7 +133,7 @@ export function getAllEvidenceForRequest(request, userData) {
watchlistDict[typeEnum.userKeyword].forEach((keyword) => {
executeAndPush(
regexSearch(
strRequest,
decodedStrReq,
keyword,
rootUrl,
reqUrl,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/indexed-db/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const setDefaultSettings = async () => {
browser.tabs.create({ url: browser.runtime.getURL("options.html") });
}

loadModel();
await loadModel();
}

/**
Expand Down

0 comments on commit 824001a

Please sign in to comment.