Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 559 #563

Merged
merged 8 commits into from
Mar 15, 2024
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
Loading