diff --git a/assets/fonts/fira-code/ttf/FiraCode-Bold.ttf b/assets/fonts/fira-code/ttf/FiraCode-Bold.ttf new file mode 100644 index 0000000..f891bde Binary files /dev/null and b/assets/fonts/fira-code/ttf/FiraCode-Bold.ttf differ diff --git a/assets/fonts/fira-code/ttf/FiraCode-Light.ttf b/assets/fonts/fira-code/ttf/FiraCode-Light.ttf new file mode 100644 index 0000000..5664ec3 Binary files /dev/null and b/assets/fonts/fira-code/ttf/FiraCode-Light.ttf differ diff --git a/assets/fonts/fira-code/ttf/FiraCode-Medium.ttf b/assets/fonts/fira-code/ttf/FiraCode-Medium.ttf new file mode 100644 index 0000000..2c0ecdf Binary files /dev/null and b/assets/fonts/fira-code/ttf/FiraCode-Medium.ttf differ diff --git a/assets/fonts/fira-code/ttf/FiraCode-Regular.ttf b/assets/fonts/fira-code/ttf/FiraCode-Regular.ttf new file mode 100644 index 0000000..bd73685 Binary files /dev/null and b/assets/fonts/fira-code/ttf/FiraCode-Regular.ttf differ diff --git a/assets/fonts/fira-code/ttf/FiraCode-Retina.ttf b/assets/fonts/fira-code/ttf/FiraCode-Retina.ttf new file mode 100644 index 0000000..660742d Binary files /dev/null and b/assets/fonts/fira-code/ttf/FiraCode-Retina.ttf differ diff --git a/assets/fonts/fira-code/ttf/FiraCode-SemiBold.ttf b/assets/fonts/fira-code/ttf/FiraCode-SemiBold.ttf new file mode 100644 index 0000000..d8dcef6 Binary files /dev/null and b/assets/fonts/fira-code/ttf/FiraCode-SemiBold.ttf differ diff --git a/assets/fonts/fira-code/variable_ttf/FiraCode-VF.ttf b/assets/fonts/fira-code/variable_ttf/FiraCode-VF.ttf new file mode 100644 index 0000000..c05ac82 Binary files /dev/null and b/assets/fonts/fira-code/variable_ttf/FiraCode-VF.ttf differ diff --git a/assets/fonts/fira-code/woff/FiraCode-Bold.woff b/assets/fonts/fira-code/woff/FiraCode-Bold.woff new file mode 100644 index 0000000..74e57c4 Binary files /dev/null and b/assets/fonts/fira-code/woff/FiraCode-Bold.woff differ diff --git a/assets/fonts/fira-code/woff/FiraCode-Light.woff b/assets/fonts/fira-code/woff/FiraCode-Light.woff new file mode 100644 index 0000000..1c1ebc6 Binary files /dev/null and b/assets/fonts/fira-code/woff/FiraCode-Light.woff differ diff --git a/assets/fonts/fira-code/woff/FiraCode-Medium.woff b/assets/fonts/fira-code/woff/FiraCode-Medium.woff new file mode 100644 index 0000000..19251b0 Binary files /dev/null and b/assets/fonts/fira-code/woff/FiraCode-Medium.woff differ diff --git a/assets/fonts/fira-code/woff/FiraCode-Regular.woff b/assets/fonts/fira-code/woff/FiraCode-Regular.woff new file mode 100644 index 0000000..8816b69 Binary files /dev/null and b/assets/fonts/fira-code/woff/FiraCode-Regular.woff differ diff --git a/assets/fonts/fira-code/woff/FiraCode-SemiBold.woff b/assets/fonts/fira-code/woff/FiraCode-SemiBold.woff new file mode 100644 index 0000000..97857db Binary files /dev/null and b/assets/fonts/fira-code/woff/FiraCode-SemiBold.woff differ diff --git a/assets/fonts/fira-code/woff/FiraCode-VF.woff b/assets/fonts/fira-code/woff/FiraCode-VF.woff new file mode 100644 index 0000000..c3407ed Binary files /dev/null and b/assets/fonts/fira-code/woff/FiraCode-VF.woff differ diff --git a/assets/fonts/fira-code/woff2/FiraCode-Bold.woff2 b/assets/fonts/fira-code/woff2/FiraCode-Bold.woff2 new file mode 100644 index 0000000..349dc36 Binary files /dev/null and b/assets/fonts/fira-code/woff2/FiraCode-Bold.woff2 differ diff --git a/assets/fonts/fira-code/woff2/FiraCode-Light.woff2 b/assets/fonts/fira-code/woff2/FiraCode-Light.woff2 new file mode 100644 index 0000000..eeaa303 Binary files /dev/null and b/assets/fonts/fira-code/woff2/FiraCode-Light.woff2 differ diff --git a/assets/fonts/fira-code/woff2/FiraCode-Medium.woff2 b/assets/fonts/fira-code/woff2/FiraCode-Medium.woff2 new file mode 100644 index 0000000..7f1d770 Binary files /dev/null and b/assets/fonts/fira-code/woff2/FiraCode-Medium.woff2 differ diff --git a/assets/fonts/fira-code/woff2/FiraCode-Regular.woff2 b/assets/fonts/fira-code/woff2/FiraCode-Regular.woff2 new file mode 100644 index 0000000..f8b63fb Binary files /dev/null and b/assets/fonts/fira-code/woff2/FiraCode-Regular.woff2 differ diff --git a/assets/fonts/fira-code/woff2/FiraCode-SemiBold.woff2 b/assets/fonts/fira-code/woff2/FiraCode-SemiBold.woff2 new file mode 100644 index 0000000..ccbefc8 Binary files /dev/null and b/assets/fonts/fira-code/woff2/FiraCode-SemiBold.woff2 differ diff --git a/assets/fonts/fira-code/woff2/FiraCode-VF.woff2 b/assets/fonts/fira-code/woff2/FiraCode-VF.woff2 new file mode 100644 index 0000000..e755a9d Binary files /dev/null and b/assets/fonts/fira-code/woff2/FiraCode-VF.woff2 differ diff --git a/assets/icons/cookie.svg b/assets/icons/cookie.svg new file mode 100644 index 0000000..a86710d --- /dev/null +++ b/assets/icons/cookie.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/warning.svg b/assets/icons/warning.svg new file mode 100644 index 0000000..de8e706 --- /dev/null +++ b/assets/icons/warning.svg @@ -0,0 +1,3 @@ + + + diff --git a/esbuild.config.js b/esbuild.config.js index 2087c5d..8f38539 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -12,6 +12,7 @@ esbuild ], bundle: true, outdir: './lib', + loader: { '.woff': 'file', '.woff2': 'file' }, plugins: [scss(), svg()], watch: { onRebuild(error, result) { diff --git a/memory.ts b/memory.ts index 6db0ad0..92c86ec 100644 --- a/memory.ts +++ b/memory.ts @@ -56,7 +56,7 @@ export default class Memory extends EventEmitter { } return true; } catch (e) { - debugger; + // debugger; } } diff --git a/sidebar/colors.scss b/sidebar/colors.scss index ea370e4..f95e614 100644 --- a/sidebar/colors.scss +++ b/sidebar/colors.scss @@ -1,2 +1,5 @@ $mid-grey: #2e3a59; +$disabled-grey: #8a949f; $light-grey: #d1d1d1; +$blue: #0048D9; +$icd-yellow: #ffee2c; diff --git a/sidebar/fonts.scss b/sidebar/fonts.scss new file mode 100644 index 0000000..360cc80 --- /dev/null +++ b/sidebar/fonts.scss @@ -0,0 +1,49 @@ +@font-face { + font-family: 'Fira Code'; + src: url('./../assets/fonts/fira-code/woff2/FiraCode-Light.woff2') format('woff2'), + url('./../assets/fonts/fira-code/woff/FiraCode-Light.woff') format('woff'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: 'Fira Code'; + src: url('./../assets/fonts/fira-code/woff2/FiraCode-Regular.woff2') format('woff2'), + url('./../assets/fonts/fira-code/woff/FiraCode-Regular.woff') format('woff'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: 'Fira Code'; + src: url('./../assets/fonts/fira-code/woff2/FiraCode-Medium.woff2') format('woff2'), + url('./../assets/fonts/fira-code/woff/FiraCode-Medium.woff') format('woff'); + font-weight: 500; + font-style: normal; +} + +@font-face { + font-family: 'Fira Code'; + src: url('./../assets/fonts/fira-code/woff2/FiraCode-SemiBold.woff2') format('woff2'), + url('./../assets/fonts/fira-code/woff/FiraCode-SemiBold.woff') format('woff'); + font-weight: 600; + font-style: normal; +} + +@font-face { + font-family: 'Fira Code'; + src: url('./../assets/fonts/fira-code/woff2/FiraCode-Bold.woff2') format('woff2'), + url('./../assets/fonts/fira-code/woff/FiraCode-Bold.woff') format('woff'); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: 'Fira Code VF'; + src: url('./../assets/fonts/fira-code/woff2/FiraCode-VF.woff2') + format('woff2-variations'), + url('./../assets/fonts/fira-code/woff/FiraCode-VF.woff') format('woff-variations'); + /* font-weight requires a range: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide#Using_a_variable_font_font-face_changes */ + font-weight: 300 700; + font-style: normal; +} diff --git a/sidebar/global.scss b/sidebar/global.scss index 6beb2ad..c04c5d1 100644 --- a/sidebar/global.scss +++ b/sidebar/global.scss @@ -1,3 +1,5 @@ +@import './fonts.scss'; + * { margin: 0px; padding: 0px; @@ -10,7 +12,8 @@ html { font-size: 1rem; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, + Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; } button { @@ -45,7 +48,3 @@ select { flex-flow: column; justify-content: flex-start; } - -tr:hover { - background-color: hsla(0, 0%, 0%, 0.1); -} diff --git a/sidebar/sidebar.scss b/sidebar/sidebar.scss index b579504..2315d17 100644 --- a/sidebar/sidebar.scss +++ b/sidebar/sidebar.scss @@ -1,79 +1,83 @@ @import './colors.scss'; -header { - display: grid; - grid-template-columns: 8rem 1fr 1rem; - max-height: 4rem; - padding-top: 0.5rem; - padding-bottom: 0.5rem; - border-bottom: 1px solid $light-grey; - position: sticky; - top: 0; - background: #fff; - - .webpage-metadata { - word-break: break-all; - display: flex; - flex-flow: column; - flex-wrap: nowrap; - font-size: 0.875rem; - font-weight: 600; - justify-content: center; - padding-left: 1rem; - color: #000; - // height: 1rem; - - &--hyperlink { - font-weight: 400; - color: $mid-grey; - max-height: 2rem; - overflow: hidden; - } - } - - button { - border: none; - background: transparent; - cursor: pointer; - padding: 0; - } -} - -nav { - padding: 0.25rem 0; - border-bottom: 1px solid $light-grey; - - button { - border: none; - cursor: pointer; - color: $mid-grey; - padding: 0.25rem 0rem; - display: flex; - flex-wrap: nowrap; - line-height: 1rem; - line-height: 1.5rem; +.sidebar { + .header { + display: grid; + grid-template-columns: 8rem 1fr 1rem; + max-height: 4rem; + padding-top: 0.5rem; + padding-bottom: 0.5rem; + border-bottom: 1px solid $light-grey; + position: sticky; + top: 0; background: #fff; - width: 100%; + z-index: 1; - &:hover { - color: #000; - text-decoration: underline; - svg path { - fill: #000; - } - } - - &:disabled { - color: $light-grey; - svg path { - fill: $light-grey; - } - } - - span { - padding-left: 0.5rem; + .webpage-metadata { + word-break: break-all; + display: flex; + flex-flow: column; + flex-wrap: nowrap; font-size: 0.875rem; - font-weight: 500; + font-weight: 600; + justify-content: center; + padding-left: 1rem; + color: #000; + // height: 1rem; + + &--hyperlink { + font-weight: 400; + color: $mid-grey; + max-height: 2rem; + overflow: hidden; + } + } + + button { + border: none; + background: transparent; + cursor: pointer; + padding: 0; + } + } + + nav { + padding: 0.25rem 0; + border-bottom: 1px solid $light-grey; + + button { + border: none; + cursor: pointer; + color: $mid-grey; + padding: 0.25rem 0rem; + display: flex; + flex-wrap: nowrap; + line-height: 1rem; + line-height: 1.5rem; + background: #fff; + width: 100%; + + &:hover { + color: #000; + text-decoration: underline; + svg path { + fill: #000; + } + } + + &:disabled { + cursor: not-allowed; + color: $disabled-grey; + svg path { + fill: $disabled-grey; + } + } + + span { + padding-left: 0.5rem; + font-size: 0.875rem; + font-weight: 500; + } } } } diff --git a/sidebar/sidebar.tsx b/sidebar/sidebar.tsx index 9b76025..5f3085d 100644 --- a/sidebar/sidebar.tsx +++ b/sidebar/sidebar.tsx @@ -59,7 +59,7 @@ const Sidebar = () => { }, [counter, origin]); return ( - +
{/*
*/} -
+
{ {/*
Footer marks → {JSON.stringify(marksOccurrence)}
*/} - +
); }; diff --git a/sidebar/stolen-data-cluster.scss b/sidebar/stolen-data-cluster.scss new file mode 100644 index 0000000..29f70fb --- /dev/null +++ b/sidebar/stolen-data-cluster.scss @@ -0,0 +1,135 @@ +@import './colors.scss'; + +.stolen-data-cluster-container { + .domains-container { + padding-top: 1rem; + display: flex; + flex-flow: column; + border-bottom: none; + + .domain { + color: $mid-grey; + font-size: 0.875rem; + font-weight: 600; + text-decoration: none; + } + + .subdomains-container { + .subdomain { + color: $blue; + font-size: 0.75rem; + font-weight: 600; + text-decoration: none; + } + } + } + + section { + padding-bottom: 0.5rem; + border-bottom: 1px solid $light-grey; + } + + table { + width: 100%; + position: relative; + left: -2px; + text-align: left; + font-size: 0.75rem; + font-family: 'Fira Code'; + border-collapse: separate; + border-spacing: 1px; + + tr { + vertical-align: middle; + + &:hover { + background-color: $icd-yellow; + color: $mid-grey !important; + cursor: pointer; + } + + &.untoggled { + color: $disabled-grey; + font-weight: 500; + } + + &.toggled { + font-weight: 600; + color: $mid-grey; + + th { + font-weight: 600; + } + } + th { + text-align: left; + text-overflow: ellipsis; + overflow: hidden; + word-wrap: normal; + word-break: normal; + padding-left: 0.25rem; + font-weight: 500; + vertical-align: middle; + width: 10rem; + min-width: 10rem; + max-width: 10rem; + } + } + + .value { + overflow: hidden; + word-break: break-all; + text-overflow: clip; + } + + .icons { + white-space: nowrap; + padding: 0 0.25rem; + position: relative; + top: 2px; + + .cookie-data { + path { + fill: #000; + } + } + .request-with-cookie { + path { + fill: #000; + } + } + .show-history-part { + path { + fill: #000; + } + } + .request-with-history-part { + path { + fill: #000; + } + } + } + + .table-header { + color: $mid-grey; + font-size: 0.75rem; + font-weight: 600; + padding: 0.5rem 0; + text-align: left; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, + Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', + sans-serif; + + &:hover { + background: #fff; + } + } + .checkbox { + // background: red; + // width: 1rem; + position: relative; + top: 1px; + width: 0.875rem; + } + } +} diff --git a/sidebar/stolen-data-cluster.tsx b/sidebar/stolen-data-cluster.tsx index 7ca3139..8c8a4fc 100644 --- a/sidebar/stolen-data-cluster.tsx +++ b/sidebar/stolen-data-cluster.tsx @@ -1,8 +1,12 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import { getMemory } from '../memory'; import { StolenDataEntry } from '../stolen-data-entry'; import { maskString, useEmitter } from '../util'; +import CookieIcon from '../assets/icons/cookie.svg'; +import WarningIcon from '../assets/icons/warning.svg'; + +import './stolen-data-cluster.scss'; const MAX_STRING_VALUE_LENGTH = 100; @@ -24,15 +28,16 @@ function StolenDataValue({ ); } return ( -
{ entry.toggleMark(); e.stopPropagation(); }} - style={{ color: entry.isMarked ? 'black' : 'gray' }} + // style={{ color: entry.isMarked ? 'black' : 'gray' }} > {body} -
+ ); } @@ -45,8 +50,12 @@ function StolenDataRow({ }) { const [version] = useEmitter(entry); return ( - - + + { entry.toggleMark(); @@ -69,31 +75,51 @@ function StolenDataRow({ > {entry.name} - + {entry.source === 'cookie' ? ( - 🍪 + + + ) : entry.request.hasCookie() ? ( - 🍪 + ) : null} {entry.exposesOrigin() ? ( - ⚠️ + + + ) : entry.request.exposesOrigin() ? ( - ⚠️ + ) : null} - - - + {/* */} + + ); } @@ -115,56 +141,106 @@ export default function StolenDataCluster({ cookiesOrOriginOnly: boolean; }) { const cluster = getMemory().getClustersForOrigin(origin)[shorthost]; + const fullHosts = cluster.getFullHosts(); + return ( -
-

- {cluster.id}{' '} - {cluster.hasCookies() ? '🍪' : ''} x{cluster.requests.length}{' '} - {/* getMemory().removeCookiesFor(origin, shorthost)} - * > - * Wyczyść cookiesy - * */} - { - cluster.autoMark(); - refresh(); - e.preventDefault(); - }} - > - Zaznacz auto +

-
- {cluster.getFullHosts().map((host) => ( - - {host},{' '} - - ))} -
- - - {cluster - .calculateRepresentativeStolenData({ - minValueLength, - cookiesOnly, - cookiesOrOriginOnly, - }) - .map((entry) => ( - - ))} - -
+
+ {fullHosts.map((host, index) => ( + + {host}{' '} + {`${fullHosts.length - 1 !== index ? '· ' : ''}`} + + ))} +
+ +
+ + + + + + + + {cluster + .calculateRepresentativeStolenData({ + minValueLength, + cookiesOnly, + cookiesOrOriginOnly, + }) + .map((entry) => ( + + ))} + +
+ Znalezione ustawienia: +
+
+ + //
+ //

+ // {cluster.id}{' '} + // {cluster.hasCookies() ? '🍪' : ''} x{cluster.requests.length}{' '} + // {/* getMemory().removeCookiesFor(origin, shorthost)} + // * > + // * Wyczyść cookiesy + // * */} + // { + // cluster.autoMark(); + // refresh(); + // e.preventDefault(); + // }} + // > + // Zaznacz auto + // + //

+ //
+ // {cluster.getFullHosts().map((host) => ( + // + // {host},{' '} + // + // ))} + //
+ // + // + // {cluster + // .calculateRepresentativeStolenData({ + // minValueLength, + // cookiesOnly, + // cookiesOrOriginOnly, + // }) + // .map((entry) => ( + // + // ))} + // + //
+ //
); } diff --git a/sidebar/stolen-data.scss b/sidebar/stolen-data.scss new file mode 100644 index 0000000..3e01021 --- /dev/null +++ b/sidebar/stolen-data.scss @@ -0,0 +1,10 @@ +@import './colors.scss'; + +.stolen-data-container { + padding-top: .5rem; + span { + color: $mid-grey; + font-size: 0.75rem; + font-weight: 600; + } +} \ No newline at end of file diff --git a/sidebar/stolen-data.tsx b/sidebar/stolen-data.tsx index 5a3d4a9..02a044f 100644 --- a/sidebar/stolen-data.tsx +++ b/sidebar/stolen-data.tsx @@ -5,6 +5,8 @@ import StolenDataCluster from './stolen-data-cluster'; import { getshorthost } from '../util'; import { getMemory } from '../memory'; +import './stolen-data.scss'; + export function StolenData({ origin, minValueLength, @@ -21,7 +23,11 @@ export function StolenData({ cookiesOrOriginOnly: boolean; }) { if (!origin) { - return
; + return ( +
+ Otwórz nową kartę z wybraną stroną internetową +
+ ); } const clusters = Object.values(getMemory().getClustersForOrigin(origin)) .sort(RequestCluster.sortCompare) @@ -33,9 +39,8 @@ export function StolenData({ cluster.exposesOrigin() ); return ( -
-
- {/* */} - {/* */} - {/* */} - {clusters.map((cluster) => { - return ( - - ); - })} -
+ Domeny otrzymujące informacje + + {clusters.map((cluster) => { + return ( + + ); + })}
); }