repo_name stringlengths 1 62 | dataset stringclasses 1
value | lang stringclasses 11
values | pr_id int64 1 20.1k | owner stringlengths 2 34 | reviewer stringlengths 2 39 | diff_hunk stringlengths 15 262k | code_review_comment stringlengths 1 99.6k |
|---|---|---|---|---|---|---|---|
ps-analysis-tool | github_2023 | others | 211 | GoogleChromeLabs | gagan0123 | @@ -0,0 +1,77 @@
+#!/bin/bash
+
+# Download Extension
+extension_setup() {
+ ps_analysis_tool_version=v0.3.1
+ cd /tmp/
+ if [ ! -d /tmp/ps-analysis-tool-$ps_analysis_tool_version ]; then
+ mkdir -p /tmp/ps-analysis-tool-$ps_analysis_tool_version
+ curl -L -O -s https://github.com/GoogleChromeLabs/ps-analysis... | Modify it to get the version from the `ps_analysis_tool_version` variable that we defined |
ps-analysis-tool | github_2023 | others | 211 | GoogleChromeLabs | gagan0123 | @@ -0,0 +1,77 @@
+#!/bin/bash
+
+# Download Extension
+extension_setup() {
+ ps_analysis_tool_version=v0.3.1
+ cd /tmp/
+ if [ ! -d /tmp/ps-analysis-tool-$ps_analysis_tool_version ]; then
+ mkdir -p /tmp/ps-analysis-tool-$ps_analysis_tool_version
+ curl -L -O -s https://github.com/GoogleChromeLabs/ps-analysis... | Modify it to get the version from the `ps_analysis_tool_version` variable that we defined |
ps-analysis-tool | github_2023 | others | 211 | GoogleChromeLabs | gagan0123 | @@ -0,0 +1,77 @@
+#!/bin/bash
+
+# Download Extension
+extension_setup() {
+ ps_analysis_tool_version=v0.3.1
+ cd /tmp/ | When we do `cd /tmp/` the directory is changed to that, and does not revert back to where we started, can we please ensure that after downloading and setting up the extension, we go back to the directory where we were? |
ps-analysis-tool | github_2023 | others | 211 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,82 @@
+#!/bin/bash
+
+# Download Extension
+extension_setup() {
+ ps_analysis_tool_version=v0.3.1 | v0.3.2 just released today |
ps-analysis-tool | github_2023 | typescript | 367 | GoogleChromeLabs | ayushnirwal | @@ -91,13 +91,13 @@ const CookiesMatrix = ({
: [
{
title: 'Number of Frames',
- description: 'Number of frames found on the page.',
+ description: 'Number of unique frames found across the page(s).',
count: totalFrames,
expand: isExpanded,
},
... | ```suggestion
description: 'Unique frames across the page(s) that have cookies associated with them.',
``` |
ps-analysis-tool | github_2023 | typescript | 382 | GoogleChromeLabs | gagan0123 | @@ -77,7 +77,10 @@ export default function prepareFrameStatsComponent(
return {
dataMapping: [
{
- title: 'Frame details',
+ title: | @fellyph
As I mentioned, we need to change the "Frame details" to **"Frames"** and not "Frames details" |
ps-analysis-tool | github_2023 | typescript | 364 | GoogleChromeLabs | ayushnirwal | @@ -60,14 +60,15 @@ const processAndStoreDocumentCookies = async ({
const parsedCookieData: CookieData[] = await Promise.all(
documentCookies.map(async (singleCookie: string) => {
- const cookieValue = singleCookie.split('=')[1]?.trim();
- const cookieName = singleCookie.split('=')[0... | ```suggestion
const [name,...rest] = singleCookie.split('=');
``` |
ps-analysis-tool | github_2023 | typescript | 364 | GoogleChromeLabs | ayushnirwal | @@ -60,14 +60,15 @@ const processAndStoreDocumentCookies = async ({
const parsedCookieData: CookieData[] = await Promise.all(
documentCookies.map(async (singleCookie: string) => {
- const cookieValue = singleCookie.split('=')[1]?.trim();
- const cookieName = singleCookie.split('=')[0... | ```suggestion
name: name.trim(),
``` |
ps-analysis-tool | github_2023 | typescript | 333 | GoogleChromeLabs | ayushnirwal | @@ -49,6 +99,38 @@ const BodyCell = ({
} cursor-default flex-1`}
>
{cell}
+ <>
+ {isExtension && | Let's not make this feature an extension-only thing. |
ps-analysis-tool | github_2023 | typescript | 333 | GoogleChromeLabs | ayushnirwal | @@ -17,28 +17,78 @@
/**
* External dependencies.
*/
-import React from 'react';
+import React, { useState, useCallback } from 'react';
+import { createPortal } from 'react-dom';
/**
* Internal dependencies.
*/
-import type { InfoType } from '../../useTable';
+import type { InfoType, TableRow } from '../../u... | Is there any reason the right-click handling is not done at the row level? |
ps-analysis-tool | github_2023 | typescript | 357 | GoogleChromeLabs | amovar18 | @@ -32,7 +32,10 @@ const Details = ({ selectedCookie }: DetailsProps) => {
const [showUrlDecoded, setShowUrlDecoded] = useState(false);
let blockedReasons = '';
let warningReasons = '';
-
+ const isCookieBlocked = | Adding a comment here for future reference, this was done because we are using 2 different APIs to gather cookie data and often the isBlocked gets toggled between true and false. Adding this as a fallback prevents from showing wrong information regarding blocked cookies. |
ps-analysis-tool | github_2023 | typescript | 357 | GoogleChromeLabs | ayushnirwal | @@ -82,7 +82,8 @@ const QuickLinksList = () => {
rel="noreferrer"
className="leading-6 text-sm text-bright-navy-blue dark:text-jordy-blue font-semibold px-3 border border-american-silver dark:border-quartz rounded inline-flex gap-2 items-center"
>
- View More <Che... | Accidental quotes from prettier? |
ps-analysis-tool | github_2023 | typescript | 357 | GoogleChromeLabs | ayushnirwal | @@ -61,11 +61,11 @@ const prepareCookiesCount = (cookies: { [key: string]: CookieData } | null) => {
).length;
cookiesCount.blockedCookies.total = cookieList.filter(
- (cookie) => cookie.isBlocked
+ (cookie) => cookie.blockedReasons && cookie.blockedReasons?.length > 0 | Doesn't it make `isBlocked` value redundant if its value can be derived from blockedReason everywhere else too? |
ps-analysis-tool | github_2023 | typescript | 357 | GoogleChromeLabs | ayushnirwal | @@ -162,7 +163,12 @@ function parseAttributeValues(
switch (type) {
case 'domain':
if (url) {
- value = value || new URL(url).hostname;
+ let domain = getDomain(url); | Let's make a utility out of this and move it to the `common` package. |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | ayushnirwal | @@ -18,7 +18,7 @@
*/
import React from 'react';
import { VictoryPie } from 'victory';
-import { COLOR_MAP } from '@ps-analysis-tool/design-system';
+import { COLOR_MAP } from '@ps-analysis-tool/common'; | Could you explain the reason for moving the color map? In my opinion, it is more of a design-system constant. |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,268 @@
+/* | I don't think these should be under `utils`, let's create a separate folder for all such files containing issue descriptions/content/data. |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,150 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | The function has some room for refactoring/improvement. |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,161 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | ```suggestion
/**
* Internal dependencies.
*/
import * as CookieWarningReasonHTMLContent from './cookieWarningReasonHTMLContent';
``` |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+import CookieWarningReason from './cookieWarningReason'; | ```suggestion
/**
* Internal dependencies.
*/
import CookieWarningReason from './cookieWarningReason';
```
Please update all imports where comment is missing. |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,76 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Let's add missing descriptions to all functions. |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,76 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | ```suggestion
let domain, url = '';
``` |
ps-analysis-tool | github_2023 | others | 270 | GoogleChromeLabs | mohdsayed | @@ -21,7 +21,9 @@
"@ps-analysis-tool/common": "*",
"@ps-analysis-tool/design-system": "*",
"classnames": "^2.3.2",
+ "date-fns": "^2.30.0",
"fast-xml-parser": "^4.3.2",
+ "moment": "^2.29.4", | What is the use of these `data-fns` and `moment` packages here? |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -152,9 +186,21 @@ function parseAttributeValues(
}
value = ((value || '') as string).toLowerCase();
}
+ if (type === 'size' && !value) {
+ const encoder = new TextEncoder();
+ value = encoder.encode(cookieValue).length;
+ }
if (type === 'expires' && value !== 0) {
- value = new Date(valu... | Too many if conditions, I think it needs some refactoring. Probably something like this,
```js
let value = parsedCookieValue || chromeStoreCookieValue || prevParsedCookieValue;
switch (type) {
case 'domain':
if (url) {
value = value || new URL(url).hostname;
} else {
valu... |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -293,7 +297,288 @@ chrome.runtime.onInstalled.addListener(async (details) => {
await chrome.storage.sync.clear();
await chrome.storage.sync.set({
allowedNumberOfTabs: 'single',
+ isUsingCDP: true,
});
}
});
});
+
+chrome.debugger.onEvent.addListener(async (source, method... | I think we are doing too much in this listener, let's refactor the code and simplify. |
ps-analysis-tool | github_2023 | others | 270 | GoogleChromeLabs | mohdsayed | @@ -62,6 +62,35 @@ module.exports = {
},
textColor: {
...colors,
+ secureonly: '#A98307',
+ domainmismatch: '#7D8471',
+ notonpath: '#79553D',
+ samesitestrict: '#AF2B1E',
+ samesitesax: '#FFA420',
+ samesiteunspecifiedtreatedaslax: '#FF7514',
+ samesitenoneinsecure: ... | Shouldn't these be color names? |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -91,7 +89,7 @@ const CookiesLanding = ({
count: totalFrames,
},
{
- title: 'Outermost Frames',
+ title: 'Top Frame', | I think `Topmost Frame` will explain it better. |
ps-analysis-tool | github_2023 | typescript | 270 | GoogleChromeLabs | mohdsayed | @@ -18,105 +18,108 @@
* External dependencies.
*/
import PQueue from 'p-queue';
+import {
+ type CookieData,
+ type AuditParams, | Does `AuditParams` exist in `common` package? |
ps-analysis-tool | github_2023 | typescript | 271 | GoogleChromeLabs | mayan-000 | @@ -44,6 +45,10 @@ program
.version('0.0.3')
.description('CLI to test a URL for 3p cookies')
.option('-u, --url <value>', 'URL of a site')
+ .option(
+ '-p, --sitemap-path <value>', | `--sitemap-path` kind of feels confusing as it looks like signifying the URL to the sitemap on the first read. Your opinions?
How about `--sitemap-file` or `--sitemap-filepath`?
|
ps-analysis-tool | github_2023 | typescript | 271 | GoogleChromeLabs | mayan-000 | @@ -179,6 +185,107 @@ export const initialize = async () => {
await delay(2000);
+ console.log(
+ `Report is being served at the URL: http://localhost:9000?dir=${encodeURIComponent(
+ prefix
+ )}&type=sitemap`
+ );
+ } else if (sitemapPath) {
+ const spinnies = new Spinnies();
+
+ ... | If we have an overall spinner for technology, can we consider the same when cookies are analyzed - [Line 254](https://github.com/GoogleChromeLabs/ps-analysis-tool/pull/271/files#diff-2fb448d11702324cc59d657d5945d59cd325540eb87b71f2e66a5bc01ada834cR254)? |
ps-analysis-tool | github_2023 | typescript | 192 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,105 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | @mayan-000 Would you mind making a separate file for `extractCookies` function. |
ps-analysis-tool | github_2023 | typescript | 192 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,67 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Input -> TextInput |
ps-analysis-tool | github_2023 | others | 192 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,3 @@
+<svg width="7" height="7" viewBox="0 0 7 7" fill="none" xmlns="http://www.w3.org/2000/svg"> | Try to use `fill="currentColor"` and give color by "color" style attribute. This way we can leverage Tailwinds design system bindings to color match. |
ps-analysis-tool | github_2023 | typescript | 192 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,48 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | NIT: I think this should be renamed as `shouldAddUrlToKey`. That way the context that landing page needs cookie keyed using page url will not be needed to understand this utility function. |
ps-analysis-tool | github_2023 | typescript | 192 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,91 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Constant for this particular key has been added [here](https://github.com/GoogleChromeLabs/ps-analysis-tool/blob/eafeffb0f3bebe28e29a34e0681294a60998c3a5/packages/common/src/index.ts#L26). |
ps-analysis-tool | github_2023 | typescript | 192 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,91 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Correct me if I am wrong but I don't see any matchers added by [jest-dom](https://github.com/testing-library/jest-dom#custom-matchers) used in this file. |
ps-analysis-tool | github_2023 | typescript | 192 | GoogleChromeLabs | ayushnirwal | @@ -60,7 +60,7 @@ export type CookieData = {
export type CookieTableData = CookieData & {
isCookieSet: boolean | null;
- frameUrl?: string;
+ frameUrl?: string | string[]; | Rename to frameUrls |
ps-analysis-tool | github_2023 | typescript | 308 | GoogleChromeLabs | amovar18 | @@ -32,6 +33,9 @@ interface NewReport extends CompleteJson {
type SanitisedCookieType = ParsedCookie & { | Can we move `SanitisedCookieType` and `SingleTechnology` to `types.ts` |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,126 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | `divRef` has an `HTMLInputElement` type.
Can we match the var and type a bit? |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,126 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | I guess we can remove this comment, the code explains itself. |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,126 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | ```suggestion
<span className="font-serif">{info ?'โ': ''}</span>
``` |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,164 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | I guess we can remove this comment, the code explains itself. |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,164 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | Need suggestion, how about `keyToChange` or something similar?
If works, please change to other components. |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,55 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Query:
`getValueForSameSite` also has kind of similar logic.
Can you explain the reason for the repetition? |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,32 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Can you please elaborate on the use/scenario of this function?
Not able to grasp the use case by name. |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -51,10 +64,82 @@ const CookieSearch = ({
})
);
- const { getCookiesSetByJavascript } = useCookieStore(({ actions }) => ({
+ const cookieDeletedRef = useRef(false); | ```suggestion
const isCookieDeleted = useRef(false);
``` |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -51,10 +64,82 @@ const CookieSearch = ({
})
);
- const { getCookiesSetByJavascript } = useCookieStore(({ actions }) => ({
+ const cookieDeletedRef = useRef(false);
+ const selectedCookieIndexRef = useRef(-1); | ```suggestion
const selectedCookieIndex = useRef(-1);
``` |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -51,10 +64,82 @@ const CookieSearch = ({
})
);
- const { getCookiesSetByJavascript } = useCookieStore(({ actions }) => ({
+ const cookieDeletedRef = useRef(false);
+ const selectedCookieIndexRef = useRef(-1);
+
+ const isAnyCookieSelected =
+ cookieDeletedRef.current && !selectedFrameCookie
+ ?... | ```suggestion
const filteredRows = filteredCookies.filter((cookie) => {
``` |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -449,6 +458,293 @@ export const Provider = ({ children }: PropsWithChildren) => {
}
}, []);
+ const deleteCookie = useCallback(
+ async (cookieKey: string) => {
+ const localStorage = await chrome.storage.local.get();
+ if (tabId) {
+ const tabData = localStorage[tabId];
+ const... | ```suggestion
const oldData = await chrome.storage.local.get();
const updatedCookie = {
[newCookieKey]: {
...cookieDetails,
parsedCookie: {
...cookieDetails.parsedCookie,
[changedKey === 'expirat... |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | ayushnirwal | @@ -193,7 +193,7 @@ export default class Utility {
const cookie: Cookie = {
name: '',
value: '',
- expires: 0,
+ expires: 'Session', | This change seems unrelated to what this PR implements. Also, I don't think this utility was being used in the extension. If that's not the case let's move this to the `common` package. |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,32 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | currentIndex > 0. |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,32 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | return -100 ? |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -449,6 +457,306 @@ export const Provider = ({ children }: PropsWithChildren) => {
}
}, []);
+ const deleteCookie = useCallback(
+ async (cookieKey: string) => {
+ const localStorage = await chrome.storage.local.get();
+ if (tabId) {
+ const tabData = localStorage[tabId];
+ const... | ```suggestion
if (!allCookies) {
return;
}
const cookieKeys: string[] = [];
await Promise.all(
currentFrame.frameIds.map(async (frameId) => {
await Promise.all(
Object.keys(allCookies).map(async (key) => {
... |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,163 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | ```suggestion
const isUpdateDone = await modifyCookie(
```
Please check for other editable components. |
ps-analysis-tool | github_2023 | typescript | 278 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,128 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | Should go under External dependencies, please check other places too. |
ps-analysis-tool | github_2023 | typescript | 318 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,80 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | How about if it's a constant we can use capitalized snack case? |
ps-analysis-tool | github_2023 | typescript | 318 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,80 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Capitalized Snack Case. |
ps-analysis-tool | github_2023 | typescript | 318 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,113 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | Query: Can `map.size` work for assigning totalCookies? |
ps-analysis-tool | github_2023 | typescript | 318 | GoogleChromeLabs | mayan-000 | @@ -0,0 +1,61 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Capitalized snack case |
ps-analysis-tool | github_2023 | typescript | 318 | GoogleChromeLabs | amovar18 | @@ -0,0 +1,80 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Nitpick can ignore this `getting` spelling is wrong. |
ps-analysis-tool | github_2023 | typescript | 122 | GoogleChromeLabs | mohdsayed | @@ -56,33 +39,53 @@ export const FILTER_MAPPING = [
sort: true,
order: 9,
},
- {
- name: 'Cookie Accepted',
- keys: 'isCookieSet',
- type: 'boolean',
- order: 10,
- description:
- "Whether the cookie was accepted(set) in Chrome's Cookie Store",
- },
];
+export enum RetentionPeriodF... | JFI, we are planning to add Expired as well. |
ps-analysis-tool | github_2023 | typescript | 122 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,174 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | Not to be done immediately, but I think we shouldn't use text strings in logic for any filter labels like we were doing for retention period. |
ps-analysis-tool | github_2023 | typescript | 122 | GoogleChromeLabs | ayushnirwal | @@ -25,7 +25,10 @@ import type {
SelectedFilters,
Filter,
} from '../../../../../stateProviders/filterManagementStore/types';
-import { FILTER_MAPPING } from '../../../../../stateProviders/filterManagementStore/constants';
+import {
+ CUSTOM_FILTER_MAPPING,
+ FILTER_MAPPING,
+} from '../../../../../stateProvid... | Could you please add types and constants to the index file of filter management store so these can be imported with one statement |
ps-analysis-tool | github_2023 | typescript | 122 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,174 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | I think using enums would be beneficial similar to retention period filtering. |
ps-analysis-tool | github_2023 | typescript | 122 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,46 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | @sayedtaqui Did we plan to only search through name and domain? |
ps-analysis-tool | github_2023 | typescript | 122 | GoogleChromeLabs | ayushnirwal | @@ -56,33 +39,53 @@ export const FILTER_MAPPING = [
sort: true,
order: 9,
},
- {
- name: 'Cookie Accepted',
- keys: 'isCookieSet',
- type: 'boolean',
- order: 10,
- description:
- "Whether the cookie was accepted(set) in Chrome's Cookie Store",
- },
];
+export enum RetentionPeriodF... | Do these need to be a set now if they are hard coded? |
ps-analysis-tool | github_2023 | typescript | 193 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,166 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | `data` can be passed as an argument to useState hook here |
ps-analysis-tool | github_2023 | typescript | 193 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,166 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | This function does not use any state or ref vars please consider moving it out of the component. |
ps-analysis-tool | github_2023 | typescript | 193 | GoogleChromeLabs | ayushnirwal | @@ -24,7 +24,7 @@ interface MessageBoxProps {
}
const MessageBox = ({ headerText, bodyText }: MessageBoxProps) => {
return (
- <div className="bg-hsl-light dark:hsl-dark p-4 m-3 leading-5 max-w-2xl">
+ <div className="bg-hsl-light dark:hsl-dark py-4 my-3 leading-5 max-w-2xl"> | AFAIK the thing this PR wants to implement, this change seems unrelated. |
ps-analysis-tool | github_2023 | typescript | 193 | GoogleChromeLabs | ayushnirwal | @@ -16,77 +16,117 @@
/**
* External dependencies.
*/
-import React, { useState } from 'react';
+import React, { useEffect, useMemo, useState } from 'react';
import { Resizable } from 're-resizable';
+import {
+ CookieIcon,
+ CookieIconWhite,
+ Sidebar,
+ useSidebar,
+ type SidebarItem,
+} from '@ps-analysis-... | Seems unrelated to this PR.
|
ps-analysis-tool | github_2023 | typescript | 243 | GoogleChromeLabs | ayushnirwal | @@ -36,3 +36,4 @@ export * from './landingPage/infoCard/fetchPSInfo';
export { default as ErrorFallback } from './errorFallback';
export { default as ExtensionReloadNotification } from './errorFallback/extensionReloadNotification';
export * from './table';
+export { default as Input } from './input'; | Input -> SearchInput |
ps-analysis-tool | github_2023 | typescript | 231 | GoogleChromeLabs | mohdsayed | @@ -128,11 +125,15 @@ const CookieTableContainer = ({
),
},
{
- header: 'Cookie Accepted',
+ header: 'Cookie Affected', | Do you want to keep the name as โCookie Affectedโ only? |
ps-analysis-tool | github_2023 | typescript | 213 | GoogleChromeLabs | mohdsayed | @@ -65,7 +65,7 @@ const SiteMapReport = ({
const frames = useMemo(() => {
return Object.keys(cookies).reduce((acc, frame) => {
- if (frame?.includes('http') || frame === 'Unknown Frame') {
+ if (frame?.includes('http') || frame === 'Unknown Frame(s)') { | @mayan-000 `Unknown Frame(s)` should be a constant |
ps-analysis-tool | github_2023 | typescript | 200 | GoogleChromeLabs | mohdsayed | @@ -14,10 +14,15 @@
* limitations under the License.
*/
export const getCurrentTab = () => {
- return chrome.tabs.query({
- active: true,
- currentWindow: true,
- });
+ try {
+ return chrome.tabs.query({ | ๐ |
ps-analysis-tool | github_2023 | typescript | 171 | GoogleChromeLabs | ayushnirwal | @@ -6,8 +6,10 @@ import type { RuleSetRule } from 'webpack';
const config: StorybookConfig = {
stories: [
- '../packages/**/src/**/stories/*.mdx',
- '../packages/**/src/**/stories/**/*.stories.@(js|jsx|ts|tsx)',
+ '../packages/extension/src/**/stories/*.mdx',
+ '../packages/extension/src/**/stories/**... | no stories in cli-dashboard? |
ps-analysis-tool | github_2023 | typescript | 147 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,41 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by a... | Repeating sentences. |
ps-analysis-tool | github_2023 | typescript | 162 | GoogleChromeLabs | amovar18 | @@ -0,0 +1,239 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | Indentation issue? |
ps-analysis-tool | github_2023 | typescript | 162 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,272 @@
+/* | What is the use of these? |
ps-analysis-tool | github_2023 | typescript | 123 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,224 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | There should be some default value of pages if the user just hits enters |
ps-analysis-tool | github_2023 | typescript | 123 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,224 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | A site may have a huge number of pages, will it be able to process these if the user enters a large number? Should we also show the status of the processing? |
ps-analysis-tool | github_2023 | typescript | 123 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,224 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | I think we can organize this code better by using something like this
```js
const CLI = {
initialize(){
this.processCookies();
this.processTechnologies()
this.saveData()
},
processCookies() {},
processTechnologies(),
saveData(){},
}
``` |
ps-analysis-tool | github_2023 | typescript | 123 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,224 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | If there is a sitemap that doesn't have URLs, do not throw an error, instead show a message saying there are no URLs available for the given sitemap. Using `throw new Error(` feels like the CLI broke due to its error. |
ps-analysis-tool | github_2023 | typescript | 134 | GoogleChromeLabs | mohdsayed | @@ -17,8 +17,8 @@
* Internal dependencies. | @amovar18 I think a new directory for each store is not required because currently a single file is enough for preferences |
ps-analysis-tool | github_2023 | typescript | 146 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,117 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | I see the function doesn't return a cookie, please update the function name |
ps-analysis-tool | github_2023 | typescript | 146 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,117 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | Isn't `tabId === ''` redundant, here? |
ps-analysis-tool | github_2023 | typescript | 146 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,117 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | I think the code is getting cluttered here. Please create a separate function for it. |
ps-analysis-tool | github_2023 | typescript | 146 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,117 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | Please create a separate function for it. |
ps-analysis-tool | github_2023 | typescript | 146 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,117 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | Overriding the same variable looks a bit weird here. Either use a different name or pass the object directly in `createCookieObject` |
ps-analysis-tool | github_2023 | typescript | 146 | GoogleChromeLabs | mohdsayed | @@ -25,18 +25,74 @@ import React from 'react';
import { useCookieStore } from '../../stateProviders/syncCookieStore';
import CookiesListing from './cookiesListing';
import CookiesLanding from './cookiesLanding';
+import { Button, ProgressBar } from '../../../design-system/components';
const Cookies = () => {
- c... | Just wanted to mention that we're working on multiple things in this pull request. It would be really helpful if we could have separate pull requests for each of these issues. But don't worry, it's fine for now. |
ps-analysis-tool | github_2023 | others | 155 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,121 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | ๐
This was pending for sometime |
ps-analysis-tool | github_2023 | others | 155 | GoogleChromeLabs | mohdsayed | @@ -3,13 +3,13 @@
"version": "0.2.0",
"description": "Cookie Analysis Tool and CLI for analysis and understanding of cookie usage on web pages.",
"scripts": {
- "cli:dev": "tsc-watch",
- "cli:build": "tsc --build",
+ "cli:dev": "npm run dev --workspace=@cookie-analysis-tool/cli",
+ "cli:build": "npm run build... | ๐ |
ps-analysis-tool | github_2023 | typescript | 142 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,184 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | Could you please rename it to 'actions'. |
ps-analysis-tool | github_2023 | typescript | 148 | GoogleChromeLabs | ayushnirwal | @@ -39,18 +39,17 @@ const RWSInput = ({
}: RWSInputProps) => {
return (
<div className="flex flex-col gap">
- <label className="text-sm">{inputLabel}</label>
+ <label className="text-xs">{inputLabel}</label>
<input
type="text"
className={classNames(
- 'my-1 py-1 px-2... | py-px... ? |
ps-analysis-tool | github_2023 | typescript | 148 | GoogleChromeLabs | ayushnirwal | @@ -82,14 +122,26 @@ const Insights = () => {
</>
) : (
<p className="mt-4">
- This site is the primary domain of the Related Website Sets.
+ This site is the primary domain of the Related Website Set. | nit: set -> sets |
ps-analysis-tool | github_2023 | others | 139 | GoogleChromeLabs | mohdsayed | @@ -3,8 +3,8 @@
"version": "0.2.0",
"description": "Cookie Analysis Tool and CLI for analysis and understanding of cookie usage on web pages.",
"scripts": {
- "cli:dev": "npm run dev --workspace=@cookie-analysis-tool/cli",
- "cli:build": "npm run build --workspace=@cookie-analysis-tool/cli",
+ "cli:dev": "tsc-... | What's the purpose of using these changes? Does it run `tsc` only on CLI and common js? |
ps-analysis-tool | github_2023 | others | 139 | GoogleChromeLabs | mohdsayed | @@ -0,0 +1,32 @@
+{
+ "name": "@cookie-analysis-tool/common",
+ "version": "0.2.0",
+ "description": "", | Please add description for the package |
ps-analysis-tool | github_2023 | typescript | 128 | GoogleChromeLabs | mohdsayed | @@ -91,12 +108,25 @@ const CookieStore = {
* @param {string} tabId The tab id.
*/
async addTabData(tabId: string) {
- await chrome.storage.local.set({
- [tabId]: {
- cookies: {},
- focusedAt: Date.now(),
- },
- });
+ const extensionStorage = await chrome.storage.sync.get(); | ๐ |
ps-analysis-tool | github_2023 | typescript | 108 | GoogleChromeLabs | ayushnirwal | @@ -0,0 +1,299 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | I think this const can be moved to a different file as a testing util (./packages/extension/test-utils/consts.ts). |
ps-analysis-tool | github_2023 | typescript | 108 | GoogleChromeLabs | ayushnirwal | @@ -29,25 +29,44 @@ import { useFilterManagementStore } from '../../../../stateProviders/filterManag
import ChipsBar from '../cookieFilter/chips';
import CookieTopBar from '../cookieTopBar';
import FiltersList from '../cookieFilter';
+import { type CookieTableData } from '../../../../cookies.types';
const Cookies... | This is already calculated in frame management store. Calculation of `cookiesAvailable` can also be moved to that store. |
ps-analysis-tool | github_2023 | typescript | 101 | GoogleChromeLabs | mohdsayed | @@ -148,6 +148,9 @@ const App: React.FC = () => {
<p className="text-chart-label text-xs">
{'Inspect cookies in the "Privacy Sandbox" panel of DevTools'}
</p>
+ <p className="text-xxxs mt-4">
+ *Please disable ad/cookie blocking extensions for best results | Removing it for now, we need to think about its placement in the design. |
ps-analysis-tool | github_2023 | others | 101 | GoogleChromeLabs | mohdsayed | @@ -25,6 +25,7 @@ delete colors['coolGray'];
delete colors['blueGray'];
module.exports = {
+ darkMode: 'class', | ๐ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.