Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "module",
"private": true,
"engines": {
"node": ">= 18"
"node": ">= 20"
},
"scripts": {
"build": "yarn run rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
Expand All @@ -24,9 +24,9 @@
"@rollup/plugin-typescript": "^11.1.5",
"@types/chrome": "^0.1.4",
"@types/jest": "^29.4.0",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"eslint": "^7.32.0",
"@typescript-eslint/eslint-plugin": "8.29.1",
"@typescript-eslint/parser": "8.29.1",
"eslint": "9.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.0.0",
"prettier": "^2.3.2",
Expand Down
2 changes: 1 addition & 1 deletion src/js/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function handleMessages(
if (message.pkgRaw.includes(DYNAMIC_STRING_MARKER)) {
try {
message.pkgRaw = removeDynamicStrings(message.pkgRaw);
} catch (e) {
} catch {
sendResponse({valid: false, reason: 'failed parsing AST'});
return;
}
Expand Down
5 changes: 4 additions & 1 deletion src/js/background/historyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@ export async function upsertInvalidRecord(
const tabIDKey = String(tabID);
const entry = await chrome.storage.local.get(tabIDKey);

const violations = TAB_TO_VIOLATING_SRCS.get(tabID) ?? new Set();

if (Object.keys(entry).length !== 0) {
creationTime = entry[tabIDKey].creationTime;
entry[tabIDKey].violations.forEach(violation => {violations.add(violation)});
}

return chrome.storage.local.set({
[tabIDKey]: {
creationTime,
violations: Array.from(TAB_TO_VIOLATING_SRCS.get(tabID) ?? new Set()),
violations: Array.from(violations),
url: tab.url,
},
});
Expand Down
1 change: 1 addition & 0 deletions src/js/background/tab_state_tracker/TabStateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default class TabStateMachine extends StateMachine {
* For more details on how this suppresses the error:
* See: https://stackoverflow.com/questions/28431505/unchecked-runtime-lasterror-when-using-chrome-api/28432087#28432087
*/
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
chrome.runtime.lastError && chrome.runtime.lastError.message;
},
);
Expand Down
6 changes: 3 additions & 3 deletions src/js/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function handleManifestNode(manifestNode: HTMLScriptElement): void {
const manifestNodeTextContent = manifestNode.textContent ?? '';
try {
rawManifest = JSON.parse(manifestNodeTextContent);
} catch (manifestParseError) {
} catch {
setTimeout(() => parseFailedJSON({node: manifestNode, retry: 5000}), 20);
return;
}
Expand Down Expand Up @@ -304,7 +304,7 @@ export function storeFoundElement(element: HTMLElement): void {
if (element.getAttribute('type') === 'application/json') {
try {
JSON.parse(nodeTextContent);
} catch (parseError) {
} catch {
setTimeout(() => parseFailedJSON({node: element, retry: 1500}), 20);
}
return;
Expand Down Expand Up @@ -390,7 +390,7 @@ export const scanForScriptsAndStyles = (): void => {
childList: true,
subtree: true,
});
} catch (_UnknownError) {
} catch {
updateCurrentState(STATES.INVALID, 'unknown');
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/js/content/manualCSSInspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ function isValidCSSRule(rule: CSSRule): boolean {
function ensureCORSEnabledForStylesheet(styleSheet: CSSStyleSheet): void {
try {
// Ensure all non same origin stylesheets can be accessed (CORS)
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
styleSheet.cssRules;
} catch (e) {
} catch {
updateStateOnInvalidStylesheet(false, styleSheet);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/content/parseFailedJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function parseFailedJSON(queuedJsonToParse: {
const nodeTextContent = queuedJsonToParse.node.textContent ?? '';
try {
JSON.parse(nodeTextContent);
} catch (parseError) {
} catch {
if (queuedJsonToParse.retry > 0) {
queuedJsonToParse.retry--;
setTimeout(() => parseFailedJSON(queuedJsonToParse), 20);
Expand Down
2 changes: 1 addition & 1 deletion src/js/popup/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ let currentOrigin: Origin;
const params = new URL(document.location.href).searchParams;
setUpBackgroundMessageHandler(params.get('tab_id'));
const state = params.get('state') as State;
state && updateDisplay(state);
updateDisplay(state);
attachTextToHtml();
currentOrigin = params.get('origin') as Origin;
attachMenuListeners(currentOrigin);
Expand Down
Loading