From f44daf49098dbcdd30445859f7420268a2336db1 Mon Sep 17 00:00:00 2001 From: Arkadiusz Wieczorek Date: Sat, 9 Jul 2022 10:53:20 +0200 Subject: [PATCH] Cleanup --- components/report-window/email-content.tsx | 1 - components/report-window/problems/problem.tsx | 1 - .../report-window/screenshot-generator.tsx | 3 -- esbuild.config.js | 33 ++++++++----------- extended-request.ts | 2 -- memory.ts | 1 - test.ts | 15 --------- 7 files changed, 13 insertions(+), 43 deletions(-) delete mode 100644 test.ts diff --git a/components/report-window/email-content.tsx b/components/report-window/email-content.tsx index 2c57f6e..b6aad6e 100644 --- a/components/report-window/email-content.tsx +++ b/components/report-window/email-content.tsx @@ -25,7 +25,6 @@ export default function EmailContent({ downloadFiles: Function; user_role: string; }) { - console.log('rendering email!', answers); const _ = (key: string) => v(key, answers.zaimek); const problems = deduceProblems(answers, clusters); const explainers = Array.from( diff --git a/components/report-window/problems/problem.tsx b/components/report-window/problems/problem.tsx index edfaf96..7cc7b67 100644 --- a/components/report-window/problems/problem.tsx +++ b/components/report-window/problems/problem.tsx @@ -4,7 +4,6 @@ import { ParsedAnswers } from '../parse-answers'; function formatRange(cluster: RequestCluster) { const parts = [] as string[]; - console.log(cluster); if (cluster.hasMarkedCookies()) { parts.push('mojego identyfikatora internetowego pozyskanego z Cookie'); } diff --git a/components/report-window/screenshot-generator.tsx b/components/report-window/screenshot-generator.tsx index c364991..f8c6cf3 100644 --- a/components/report-window/screenshot-generator.tsx +++ b/components/report-window/screenshot-generator.tsx @@ -135,9 +135,6 @@ export default function ScreenshotGenerator({ setTaskId(urlArr[urlArr.length - 1]); const response = await subscribeTask(task.url); setImages(response.images); - console.log('response.images', response.images); - console.log('output', response); - setOutput(response); setRequestPath(response.zip_url); }} diff --git a/esbuild.config.js b/esbuild.config.js index 88560f8..37b9e18 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -19,25 +19,19 @@ let skipReactImports = { }; }); - build.onLoad( - { filter: /.*/, namespace: 'globalExternal_react' }, - () => { - return { - contents: `module.exports = globalThis.React`, - loader: 'js', - }; - } - ); + build.onLoad({ filter: /.*/, namespace: 'globalExternal_react' }, () => { + return { + contents: `module.exports = globalThis.React`, + loader: 'js', + }; + }); - build.onLoad( - { filter: /.*/, namespace: 'globalExternal_react-dom' }, - () => { - return { - contents: `module.exports = globalThis.ReactDOM`, - loader: 'js', - }; - } - ); + build.onLoad({ filter: /.*/, namespace: 'globalExternal_react-dom' }, () => { + return { + contents: `module.exports = globalThis.ReactDOM`, + loader: 'js', + }; + }); }, }; @@ -46,11 +40,10 @@ esbuild entryPoints: [ 'components/toolbar/toolbar.tsx', 'components/sidebar/sidebar.tsx', - 'test.ts', 'components/report-window/report-window.tsx', 'background.ts', 'styles/global.scss', - 'styles/fonts.scss' + 'styles/fonts.scss', ], bundle: true, // minify: true, diff --git a/extended-request.ts b/extended-request.ts index 54df8d3..8a9d90c 100644 --- a/extended-request.ts +++ b/extended-request.ts @@ -97,8 +97,6 @@ export default class ExtendedRequest { (this.data as any).frameAncestors = [ ...(data as any).frameAncestors.map((e: any) => ({ url: e.url })), ]; - - // console.log('→→→',(this.data as any).frameAncestors, (data as any).frameAncestors); } addHeaders(headers: Request['requestHeaders']) { diff --git a/memory.ts b/memory.ts index 2eb3376..2c6cb6f 100644 --- a/memory.ts +++ b/memory.ts @@ -78,7 +78,6 @@ export default class Memory extends SaferEmitter { if (shorthost) { const cookies = await browser.cookies.getAll({ domain: shorthost }); for (const cookie of cookies) { - console.log('removing cookie', cookie.name, 'from', cookie.domain); await browser.cookies.remove({ name: cookie.name, url: `https://${cookie.domain}`, diff --git a/test.ts b/test.ts deleted file mode 100644 index 87dd707..0000000 --- a/test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import ExtendedRequest from "./extended-request"; -import { StolenDataEntry } from "./stolen-data-entry"; -import { flattenObject, maskString } from "./util"; - -console.log(flattenObject({ a: { b: { c: [1, 2, 3] } } })); - -console.log(maskString("abcdefghijklmnopqrstuvwxyz", 1 / 3, 5)); - -console.log(maskString("abcdefghijklmnopqrstuvwxyz", 1, 30)); - -console.log( - StolenDataEntry.parseValue( - `[{"@context":"https://schema.org/","@type":"Product","image":["/medias/sys_master/root/images/h95/h8b/10873724928030/oppo-reno6-black-front.png","/medias/sys_master/root/images/h15/hb9/10873725681694/oppo-reno6-black-side.png","/medias/sys_master/root/images/hf8/h81/10873728729118/oppo-reno6-black-back.png"],"description":"OPPO Reno6 5G bez umowy lub w abonamencie w sklepie Orange. Zamów do domu lub odbierz w salonie w 24h. Transport gratis!","sku":"1100027218","brand":{"@type":"Thing","name":"OPPO"},"offers":{"@type":"Offer","priceCurrency":"PLN","priceValidUntil":"2099-12-31T00:00:00","itemCondition":"https://schema.org/UsedCondition","availability":"https://schema.org/InStock","url":"/esklep/smartfony/oppo/oppo-reno6-5g","seller":{"@type":"Organization","name":"Orange Polska S.A"},"price":"2199"},"name":"OPPO Reno6 5G"},{"@context":"http://schema.org/","@type":"Product","name":"OPPO Reno6 5G","description":"null","offers":{"@type":"Offer","priceCurrency":"PLN","price":"1248.00"}}]` - ) -);