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
typescript
713
GoogleChromeLabs
amovar18
@@ -61,7 +62,9 @@ const generateCLICookieTableCSV = (cookies: CookieTableData[]): Blob => { }
Shouldnt we translate the data as well?
ps-analysis-tool
github_2023
typescript
713
GoogleChromeLabs
amovar18
@@ -47,7 +47,7 @@ const ExtensionReloadNotification = ({ } } }} - text="Refresh panel" + text="Refresh Panel"
Should we translate this as well? Idea when app is initialised we will instantiate the message in an object according to the locale in the following manner. ``` { displayText:'', buttonText: '' } ``` Then we can pass this down to show translated string in the reload notification.
ps-analysis-tool
github_2023
typescript
713
GoogleChromeLabs
amovar18
@@ -141,13 +151,25 @@ const saveResultsAsHTML = async ( const sitemapUrl = program.opts().sitemapUrl; const csvPath = program.opts().csvPath; const sitemapPath = program.opts().sitemapPath; + const locale = program.opts().locale; const numberOfUrlsInput = program.opts().urlLimit; const isHeadless = Bool...
Can we move the above locale validation to validateArgs?
ps-analysis-tool
github_2023
typescript
715
GoogleChromeLabs
ayushnirwal
@@ -0,0 +1,101 @@ +/* + * 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 ...
Spelling Error
ps-analysis-tool
github_2023
typescript
715
GoogleChromeLabs
ayushnirwal
@@ -31,7 +31,7 @@ describe('reshapeCookies', () => { it('should return an object with the cookies', () => { const cookies = { 'https://edition.cnn.com': { - 'countryCode:.cnn.com:/': { + 'countryCode.cnn.com:/': {
Why did the key formating change?
ps-analysis-tool
github_2023
typescript
715
GoogleChromeLabs
ayushnirwal
@@ -86,6 +86,7 @@ const CookiesListing = ({ className="h-full flex" > <CookieTable + //@ts-ignore
Please add the reason for using '//@ts-ignore'.
ps-analysis-tool
github_2023
typescript
687
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,85 @@ +// /* +// * 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 +// ...
Do we want to keep commented out files?
ps-analysis-tool
github_2023
typescript
687
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,20 @@ +/* + * 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...
?
ps-analysis-tool
github_2023
typescript
687
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,51 @@ +/* + * 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...
Mix of external and internal dependencies?
ps-analysis-tool
github_2023
typescript
687
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,51 @@ +/* + * 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...
?
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mohdsayed
@@ -633,6 +999,38 @@ chrome.runtime.onMessage.addListener(async (request) => { const incomingMessageTabId = request.payload.tabId; + if ('GET_REST_DATA_FROM_URL' === incomingMessageType) { + let allCookies: CookieData[] = []; + await Promise.all( + Object.entries(frameIdToResourceMap[incomingMessageT...
The file is becoming too big, let's refactor and break it down.
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -30,66 +30,25 @@ const filterCookiesByFrame = ( if (!cookies || !frameUrl || !tabFrames || !tabFrames[frameUrl]) { return Object.values(frameFilteredCookies); } - - let tabFramesIDMap: number[] = []; + let tabFramesIDMap: string[] = []; Object.keys(tabFrames)?.forEach((url) => { const frameIds...
Not used anymore, can be removed.
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -0,0 +1,44 @@ +/* + * 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...
Other imports are addListener callbacks in their files. Like syncStorage have addListener at the bottom of the file. We can follow that consistency.
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -0,0 +1,133 @@ +/* + * 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 ...
Optional Chaining can help ```suggestion preSetSettings?.isUsingCDP ```
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -0,0 +1,200 @@ +/* + * 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 ...
Optional Chaining can help ```suggestion if (sessionStorage?.allowedNumberOfTabs) { ```
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -0,0 +1,200 @@ +/* + * 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 ...
Optional Chaining
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -0,0 +1,62 @@ +/* + * 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...
Optional Chaining
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -0,0 +1,62 @@ +/* + * 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...
Optional Chaining
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -40,6 +46,51 @@ class SynchnorousCookieStore { }; } = {}; + /** + * The cookie data of the tabs. + */ + tabMode: 'single' | 'unlimited' = 'single'; + + /** + * CookieDatabase to run analytics match on. + */ + cookieDB: CookieDatabase | null = null; + + /** + * The cookie data of the tabs. + ...
Adding JSdoc will help, and for the below variables too.
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -49,7 +100,8 @@ class SynchnorousCookieStore { devToolsOpenState: boolean; popupOpenState: boolean; newUpdates: number; - portRef: any; + frameIDURLSet: Record<string, string[]>; + parentChildFrameAssociation: Record<string, string>;
Explaining these keys in JSdoc will be helpful, as it takes some time to find callbacks and use cases.
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mayan-000
@@ -323,8 +357,133 @@ class SynchnorousCookieStore { devToolsOpenState: false, popupOpenState: false, newUpdates: 0, - portRef: null, + frameIDURLSet: {}, + parentChildFrameAssociation: {}, }; + (async () => { + if (!this.cookieDB) { + this.cookieDB = await fetchD...
Nit: Seems wrong comment for the callback.
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mohdsayed
@@ -17,790 +17,373 @@ * External dependencies. */ import { Protocol } from 'devtools-protocol'; -import { - type CookieDatabase, - type CookieData, - parseResponseReceivedExtraInfo, - parseRequestWillBeSentExtraInfo, - auditsToNetworkMap, -} from '@ps-analysis-tool/common'; /** * Internal dependencies. ...
What's the purpose of getting the target here when it is being overridden at line number 60?
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mohdsayed
@@ -17,790 +17,373 @@ * External dependencies. */ import { Protocol } from 'devtools-protocol'; -import { - type CookieDatabase, - type CookieData, - parseResponseReceivedExtraInfo, - parseRequestWillBeSentExtraInfo, - auditsToNetworkMap, -} from '@ps-analysis-tool/common'; /** * Internal dependencies. ...
Are we attaching CDP to all targets on all `ALLOWED_EVENTS` every time? Can it have any side effects when the same target is attached CDP more than once, like it happens with event listeners in JavaScript?
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mohdsayed
@@ -17,790 +17,373 @@ * External dependencies. */ import { Protocol } from 'devtools-protocol'; -import { - type CookieDatabase, - type CookieData, - parseResponseReceivedExtraInfo, - parseRequestWillBeSentExtraInfo, - auditsToNetworkMap, -} from '@ps-analysis-tool/common'; /** * Internal dependencies. ...
Will it return a different result than what already being called on line 61?
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,36 @@ +/* + * 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...
Please add some comment on what `flatten: true,` does. If it attaches CDP debugger to all sub-frames to single level.
ps-analysis-tool
github_2023
typescript
539
GoogleChromeLabs
mohdsayed
@@ -17,790 +17,373 @@ * External dependencies. */ import { Protocol } from 'devtools-protocol'; -import { - type CookieDatabase, - type CookieData, - parseResponseReceivedExtraInfo, - parseRequestWillBeSentExtraInfo, - auditsToNetworkMap, -} from '@ps-analysis-tool/common'; /** * Internal dependencies. ...
Please add comment to explain this. Something like this? // The events linked to the top frame or, occasionally, the subframe, have their source.tabId set as the tabId. // In certain cases, the source.tabId is not provided, instead, source.targetId is given. // In this case, this targetId serves as t...
ps-analysis-tool
github_2023
typescript
372
GoogleChromeLabs
ayushnirwal
@@ -265,6 +305,7 @@ export class BrowserManagement { await Promise.all( urls.map(async (url) => { await this.navigateAndScroll(url); + await this.clickOnAcceptBanner(url);
Lets refactor this routine a little bit. - Make different function for navigating to the page and scrolling it. - After that we can call the routines in the following manner. - Navigate ( This navigates to the page and waits for network stream to get idle ) - Click on Accept banner. - Wait for `this.pageWait...
ps-analysis-tool
github_2023
others
545
GoogleChromeLabs
mohdsayed
@@ -98,4 +99,35 @@ const popup = { ...commonConfig, }; -module.exports = [root, devTools, popup]; +const report = { + entry: { + index: './src/view/report/index.tsx', + }, + output: { + path: path.resolve(__dirname, '../../dist/extension/report'), + filename: '[name].js', + }, + devServer: { + st...
What is the use of creating a dev server with port 9000 for the static report?
ps-analysis-tool
github_2023
typescript
545
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,84 @@ +/* + * 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...
Instead of `App`, should the component name be Report?
ps-analysis-tool
github_2023
typescript
545
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,83 @@ +/* + * 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...
Are we going to use `any`?
ps-analysis-tool
github_2023
typescript
545
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,53 @@ +/* + * 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...
Shouldn't this be return null?
ps-analysis-tool
github_2023
typescript
545
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,62 @@ +/* + * 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 null
ps-analysis-tool
github_2023
typescript
545
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...
Move this to external dependencies
ps-analysis-tool
github_2023
typescript
545
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,62 @@ +/* + * 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...
Move to external dependencies
ps-analysis-tool
github_2023
others
575
GoogleChromeLabs
mohdsayed
@@ -81,6 +81,39 @@ const errorHandler = (err) => { process.exit(1); }; +/** + * Add keys to the locale file and replace the text with keys in the formattedData. + * @param formattedData formatted data + */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const addKeysToLocale = async (formattedData...
Is it being used?
ps-analysis-tool
github_2023
typescript
568
GoogleChromeLabs
mayan-000
@@ -121,6 +126,25 @@ export const TableProvider = ({ [tableColumns] ); + useEffect(() => { + if (selectedKey) { + const filteredRows = rows.filter((row) => { + if (!(row?.originalData as CookieTableData)?.parsedCookie) { + return true; + } + + const tableCookieKey = getC...
Need to add new optional callback prop for clearing row, can't put specific code inside table. - A callback can be created in `CookieTable` component, which handles filtering callback. - Use the callback, if passed as prop, unless always return true. ```suggestion useEffect(() => { const filteredRows =...
ps-analysis-tool
github_2023
typescript
568
GoogleChromeLabs
ayushnirwal
@@ -100,19 +100,17 @@ const Details = ({ selectedCookie, isUsingCDP }: DetailsProps) => { </p> </div> )} - {(outboundBlock || inboundBlock) && - hasValidBlockedReason && - isUsingCDP && ( - <> - <p className="font-bold text-raising-black dark:text-bright...
@amovar18 I remember having a discussion about this. Would you mind adding comments about this in your PR description.
ps-analysis-tool
github_2023
typescript
568
GoogleChromeLabs
ayushnirwal
@@ -121,6 +122,15 @@ export const TableProvider = ({ [tableColumns] ); + useEffect(() => { + const filteredRows = rows.filter( + (row) => isRowSelected?.(row.originalData) ?? true + ); + + if (filteredRows.length === 0) { + onRowClick(null); + }
```suggestion const isSomeRowSelected = rows.some( (row) => isRowSelected?.(row.originalData) ?? true ); if (!isSomeRowSelected){ onRowClick(null); } ```
ps-analysis-tool
github_2023
typescript
568
GoogleChromeLabs
ayushnirwal
@@ -516,8 +516,9 @@ chrome.debugger.onEvent.addListener((source, method, params) => { ? cookie.domain.slice(1) : cookie?.domain; - // Adding alternate domains here because our extension calculates domain differently that the application tab. - // This is done to capture both NID.google.com/ and NI...
I think this check can be an early return. it can be clubbed with the condition on line 504-507 or a additional check after that.
ps-analysis-tool
github_2023
typescript
568
GoogleChromeLabs
ayushnirwal
@@ -53,6 +53,8 @@ const processAndStoreDocumentCookies = async ({ parsedCookie.domain = singleCookie.domain?.startsWith('.') ? singleCookie.domain : '.' + singleCookie.domain; + } else { + parsedCookie.domain = window.location.hostname;
It is not immediately obvious to me that how does this change help in this PR's aim. Would you mind adding some context in the PR description?
ps-analysis-tool
github_2023
typescript
528
GoogleChromeLabs
ayushnirwal
@@ -0,0 +1,43 @@ +/*
I think these additions (useContextSelector and shallowEqual files) would be better as a different PR.
ps-analysis-tool
github_2023
typescript
528
GoogleChromeLabs
ayushnirwal
@@ -0,0 +1,88 @@ +/* + * 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...
I think @amovar18 worked on removing the need for orphaned and unmapped cookies. @amovar18 has that work been merged to develop?
ps-analysis-tool
github_2023
typescript
498
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,266 @@ +/* + * 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 ...
What is the advantage of using `chrome.devtools.inspectedWindow.tabId.toString();` over the utility function `getCurrentTabId`?
ps-analysis-tool
github_2023
typescript
498
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,266 @@ +/* + * 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 ...
`chrome.storage.local` was found out to be the slowest in Benchmarking Results of Different Chrome Storage, can we change this to session instead while we are refactoring it ? https://github.com/GoogleChromeLabs/ps-analysis-tool/issues/403#issuecomment-1884642155
ps-analysis-tool
github_2023
typescript
498
GoogleChromeLabs
mohdsayed
@@ -277,70 +98,23 @@ const App: React.FC = () => { })(); }, [allowedNumberOfTabs]); - useFrameOverlay(filteredCookies, handleUpdate); - return ( - <div - className="w-full h-screen overflow-hidden bg-white dark:bg-raisin-black" - ref={contextInvalidatedRef} + <SidebarProvider
❤️
ps-analysis-tool
github_2023
typescript
498
GoogleChromeLabs
amovar18
@@ -16,7 +16,15 @@ /**
Can we split this as well into: - `context.ts` - `sidebarProvider.tsx` - `useSidebar.ts`
ps-analysis-tool
github_2023
typescript
498
GoogleChromeLabs
mohdsayed
@@ -16,309 +16,64 @@ /** * External dependencies. */ -import React, { useRef, useEffect, useCallback, useState } from 'react'; -import { Resizable } from 're-resizable'; +import React, { useRef, useEffect, useState } from 'react'; import { - CookieIcon, - CookieIconWhite, ExtensionReloadNotification, - Side...
Lets also move the context invalidated logic to a custom hook and make App look more cleaner. I moved it in the last commit however haven't tested it. Please take a look.
ps-analysis-tool
github_2023
typescript
498
GoogleChromeLabs
amovar18
@@ -16,309 +16,64 @@ /** * External dependencies. */ -import React, { useRef, useEffect, useCallback, useState } from 'react'; -import { Resizable } from 're-resizable'; +import React, { useRef, useEffect, useState } from 'react'; import { - CookieIcon, - CookieIconWhite, ExtensionReloadNotification, - Side...
let's use chrome.devtools.inspectedWindow.tabId to minimise the use of await wherever possible.
ps-analysis-tool
github_2023
typescript
542
GoogleChromeLabs
amovar18
@@ -0,0 +1,33 @@ +/* + * 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...
Small nitpick: Add function documentation wherever necessary to increase DX
ps-analysis-tool
github_2023
typescript
519
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 ...
Isn't this a promise? I think this should be "awaited".
ps-analysis-tool
github_2023
typescript
519
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 ...
Can we just expose _setSettingsChanged directly?
ps-analysis-tool
github_2023
typescript
519
GoogleChromeLabs
ayushnirwal
@@ -0,0 +1,226 @@ +/* + * 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 ...
`chrome.runtime.sendMessage` returns a promise. Any reasons for it not being awaited anywhere?
ps-analysis-tool
github_2023
typescript
519
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,89 @@ +/* + * 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...
Missed?
ps-analysis-tool
github_2023
typescript
519
GoogleChromeLabs
mayan-000
@@ -31,3 +31,16 @@ export const SETTING_PAGE_CONTROLS = [ "The PSAT tool is designed for efficient single-tab analysis. While <a class='text-bright-navy-blue dark:text-jordy-blue' href='https://github.com/GoogleChromeLabs/ps-analysis-tool/wiki/PSAT-Settings-and-Permissions#multi-tab-debugging' target='_blank'>mu...
Typo ```suggestion export const POPUP_OPEN = 'POPUP_STATE_OPEN'; ```
ps-analysis-tool
github_2023
typescript
519
GoogleChromeLabs
mayan-000
@@ -0,0 +1,180 @@ +/* + * 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 if ( changes?.['allowedNumberOfTabs']?.['newValue'] ``` Can be used if covers the check, there are other places also in file.
ps-analysis-tool
github_2023
typescript
519
GoogleChromeLabs
mayan-000
@@ -0,0 +1,226 @@ +/* + * 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 it's not used now, can be removed if true.
ps-analysis-tool
github_2023
typescript
519
GoogleChromeLabs
mayan-000
@@ -0,0 +1,78 @@ +/* + * 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 cookieStatsComponent.legend ``` Affected Cookies are not required in this component.
ps-analysis-tool
github_2023
typescript
519
GoogleChromeLabs
mayan-000
@@ -51,33 +46,12 @@ const CookiesLandingContainer = ({ /> </div> )} - <CookiesLanding - tabFrames={tabFrames} - tabCookies={tabCookies} - showInfoIcon={false} - showBlockedInfoIcon={true} - associatedCookiesCount={Object.values(tabFrames).length} - ...
We have a missing BlockedCookiesSection here. With blocked reasons and categories, should be like this <img width="1470" alt="Screenshot 2024-03-05 at 8 23 53 PM" src="https://github.com/GoogleChromeLabs/ps-analysis-tool/assets/58820001/2f402a1b-9f6b-44e5-b76f-9475bcff113f">
ps-analysis-tool
github_2023
typescript
519
GoogleChromeLabs
mayan-000
@@ -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 ...
```suggestion setIsUsingCDPForSettingsDisplay(changes?.isUsingCDP?.newValue); ```
ps-analysis-tool
github_2023
typescript
485
GoogleChromeLabs
amovar18
@@ -120,18 +129,30 @@ const CookieTable = forwardRef< [onRowClick] ); - const selectedKey = useMemo( - () => Object.values(selectedFrameCookie ?? {})[0], - [selectedFrameCookie] + const selectedKey = useMemo(() => { + const key = Object.values(selectedFrameCookie ?? {})[0]; + + return key === nu...
@mayan-000 could we rename this variable because at an initial glance without looking at the prop it looks like a hook?
ps-analysis-tool
github_2023
typescript
485
GoogleChromeLabs
amovar18
@@ -91,48 +95,114 @@ export type PersistentStorageData = { searchValue?: string; }; -export type TableOutput = { - columns: TableColumn[]; - hideableColumns: TableColumn[]; - rows: TableRow[]; - sortKey: ColumnSortingOutput['sortKey']; - sortOrder: ColumnSortingOutput['sortOrder']; - setSortKey: ColumnSorti...
@mayan-000 can we rename the folder as tableProvider and can we split this into separate parts like `useTable.ts`, `provider.tsx`, `context.ts`?
ps-analysis-tool
github_2023
typescript
497
GoogleChromeLabs
mohdsayed
@@ -24,6 +24,14 @@ export const shallowEqual = (a: unknown, b: unknown): boolean => { } if (Array.isArray(a) && Array.isArray(b)) { + if ( + typeof a[0] === 'object' && + typeof b[0] === 'object' && + a.length === b.length + ) { + return a.every((item, index) => shallowEqualObjects(ite...
Lets add some test cases for this `shallowEqual` function.
ps-analysis-tool
github_2023
typescript
497
GoogleChromeLabs
mohdsayed
@@ -16,7 +16,7 @@ /** * External dependencies. */ -import { useContextSelector, createContext } from 'use-context-selector';
I am thinking, instead of importing `createContext` and `useContextSelector` from two different places, shall we import `createContext` from `@ps-analysis-tool/common` only ( export `createContext` from common package )
ps-analysis-tool
github_2023
typescript
511
GoogleChromeLabs
mohdsayed
@@ -65,7 +65,7 @@ const App: React.FC = () => { if (onChromeUrl) { return ( - <div className="w-full h-full flex justify-center items-center flex-col z-1 relative"> + <div className="w-full h-full flex justify-center items-center flex-col z-1">
It was updated in https://github.com/GoogleChromeLabs/ps-analysis-tool/commit/789a40aa38ca781b9830b38a0a24f94fc59e657e
ps-analysis-tool
github_2023
typescript
474
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,118 @@ +/* + * 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 add missing descriptions.
ps-analysis-tool
github_2023
others
474
GoogleChromeLabs
mohdsayed
@@ -127,6 +127,7 @@ module.exports = { 'comet-grey': '#474747', 'jet-black': '#202142', 'warning-red': '#C33300', + 'warning-orange': '#FE8d59',
This color is taken from DevTool right?
ps-analysis-tool
github_2023
typescript
476
GoogleChromeLabs
mohdsayed
@@ -291,6 +291,10 @@ chrome.runtime.onInstalled.addListener(async (details) => { syncCookieStore = new SynchnorousCookieStore(); syncCookieStore?.clear();
Please add a comment (with reference to the doc/post) mentioning why we are doing it.
ps-analysis-tool
github_2023
typescript
436
GoogleChromeLabs
ayushnirwal
@@ -15,7 +15,7 @@ */ /** - * Internal dependencies. + * External dependencies.
```suggestion * Internal dependencies. ```
ps-analysis-tool
github_2023
typescript
436
GoogleChromeLabs
ayushnirwal
@@ -0,0 +1,357 @@ +/* + * 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 we are not serializing the cookie data I think we can type `blockedReason` as a set.
ps-analysis-tool
github_2023
typescript
436
GoogleChromeLabs
ayushnirwal
@@ -14,41 +14,32 @@ * limitations under the License. */ /** - * Internal dependencies + * External dependencies
```suggestion * Internal dependencies ```
ps-analysis-tool
github_2023
typescript
436
GoogleChromeLabs
ayushnirwal
@@ -47,80 +40,60 @@ export async function createCookieObject( const value = parsedCookie.value; const cdpCookie = cookiesList?.find((cookie: Protocol.Network.Cookie) => { - return cookie.name === name && cookie.value === value; + return cookie.name === name;
Correct me if I am wrong, but aren't we supposed to check the domain and path too?
ps-analysis-tool
github_2023
typescript
436
GoogleChromeLabs
ayushnirwal
@@ -0,0 +1,44 @@ +/* + * 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...
If there are only a finite amount of tab modes, Can we convert this into an enum too?
ps-analysis-tool
github_2023
typescript
436
GoogleChromeLabs
ayushnirwal
@@ -88,7 +88,7 @@ const tabCookies = { }, }; -describe('App', () => { +xdescribe('App', () => {
Please add a comment about why this test is skipped.
ps-analysis-tool
github_2023
typescript
436
GoogleChromeLabs
mohdsayed
@@ -183,7 +184,7 @@ class WebpageContentScript { setOverlayPosition(overlay, frame); const updatePosition = () => { - if (isElementVisibleInViewport(frame, true)) { + if (isElementVisibleInViewport(frame)) {
What do we fix by removing `partiallyVisible` ?
ps-analysis-tool
github_2023
typescript
436
GoogleChromeLabs
mohdsayed
@@ -28,32 +28,26 @@ import { Protocol } from 'devtools-protocol'; /** * Internal dependencies. */ -import { CookieStore } from '../localStore'; import parseResponseCookieHeader from './parseResponseCookieHeader'; import parseRequestCookieHeader from './parseRequestCookieHeader'; -import { getTab } from '../utils...
Is it a safe place to instantiate the store? Is the service worker file called only once during the entire time?
ps-analysis-tool
github_2023
typescript
466
GoogleChromeLabs
mohdsayed
@@ -57,14 +51,14 @@ const App: React.FC = () => { const { contextInvalidated, setContextInvalidated, - tabCookies, tabFrames, selectedFrame, setSelectedFrame, isInspecting, setIsInspecting, canStartInspecting, tabUrl, + doesFrameContainCookies,
```suggestion frameHasCookies, ```
ps-analysis-tool
github_2023
typescript
446
GoogleChromeLabs
mohdsayed
@@ -33,19 +33,71 @@ const FiltersSidebar = ({ filters, toggleFilterSelection, }: FiltersSidebarProps) => { - if (!Object.keys(filters).length) { + const [expandAll, setExpandAll] = useState(false); + const expandedFilters = useRef(new Set<string>()); + const filterKeys = useMemo(() => { + return Object.ke...
These `useMemo` usage look unnecessary to me.
ps-analysis-tool
github_2023
typescript
457
GoogleChromeLabs
mayan-000
@@ -95,6 +100,14 @@ const Table = ({ [showColumnsMenu] ); + const exportCookies = useCallback(() => { + const cookies = table.rows.map(({ originalData }) => originalData); + if (cookies.length > 0 && 'parsedCookie' in cookies[0]) { + const csvTextBlob = generateCookieTableCSV(cookies as CookieTabl...
`out.csv` seems a bit vague. Can we use another name for the output file, making it more inclusive? Maybe `tableReport` or something, I'm open to others too.
ps-analysis-tool
github_2023
typescript
457
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,53 @@ +/* + * 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...
Is it possible to use `disabled` attribute in the button instead?
ps-analysis-tool
github_2023
typescript
457
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,53 @@ +/* + * 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 disabled = false, ```
ps-analysis-tool
github_2023
typescript
457
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,53 @@ +/* + * 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 title = 'Export Cookies Table', ```
ps-analysis-tool
github_2023
typescript
457
GoogleChromeLabs
mohdsayed
@@ -85,7 +90,16 @@ const TableTopBar = ({ /> <div className="h-full w-px bg-american-silver dark:bg-quartz mx-3" /> - {extraInterface} + <div className="flex gap-2"> + {extraInterface} + {exportCookies && ( + <ExportButton + title={'Exprt Cookies Table'}
```suggestion title={'Export Cookies Table'} ```
ps-analysis-tool
github_2023
typescript
457
GoogleChromeLabs
amovar18
@@ -71,6 +71,7 @@ const CookiesListing = ({ tablePersistentSettingsKey={tablePersistentSettingsKey} selectedFrame={selectedFrameUrl} selectedFrameCookie={selectedFrameCookie} + hideExport={true}
Is it necessary to pass `true` since it will be true just if we pass the attribute? See this `showFramesSection` https://github.com/GoogleChromeLabs/ps-analysis-tool/blob/85112cdd9f2f38195a8da876872590d120e48b5f/packages/extension/src/view/devtools/components/cookies/index.tsx#L111-L119
ps-analysis-tool
github_2023
typescript
425
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...
If the task is predefined the type should be an enum. The enum should have all the types of tasks that the worker supports as its elements.
ps-analysis-tool
github_2023
others
425
GoogleChromeLabs
ayushnirwal
@@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "rootDir": "src", + "types": ["chrome"] + }, + "include": [ + "src", + "../../node_modules/@types/jest/index.d.ts", + "src/**/*.json" + ],
```suggestion ], "exclude": ["**/tests/**/*.ts", "dist/**", "dist-types/**"] ```
ps-analysis-tool
github_2023
typescript
425
GoogleChromeLabs
ayushnirwal
@@ -0,0 +1,28 @@ +/* + * 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 this utility will only work if there is a worker.js file among the build artifacts, which is just the case for build artifacts of the devtools panel. That makes the dir `packages/extension/src/utils/` ( or a new util folder in `packages/extension/src/view/devtools` dir ) a better place fo...
ps-analysis-tool
github_2023
typescript
425
GoogleChromeLabs
ayushnirwal
@@ -0,0 +1,36 @@ +/* + * 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...
JS Doc return type does not match with TS's inferred type here.
ps-analysis-tool
github_2023
typescript
399
GoogleChromeLabs
ayushnirwal
@@ -36,7 +36,6 @@ import { * Internal dependencies. */ import { useCookieStore } from '../../../stateProviders/syncCookieStore'; -import { BLOCKED_REASON_LIST } from '../../../../../constants';
I see no other references to this constant in the project. Maybe we can delete it.
ps-analysis-tool
github_2023
typescript
103
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,187 @@ +/* + * 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 ...
Do we want to reuse `filterCookiesByFrame` here?
ps-analysis-tool
github_2023
typescript
103
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,55 @@ +/*
Trying to understand why we have kept `cookiesFilter` and `cookiesTopBar` outside of the `tabContent/cookies` folder in the root of the components folder. Is it going to be used anywhere else except cookies?
ps-analysis-tool
github_2023
typescript
103
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,116 @@ +/* + * 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 ...
`ArrowDown` is exported from `src/icons/index.ts`. Could we do ```js import { ArrowDown } from '../../../../icons'; ```
ps-analysis-tool
github_2023
typescript
103
GoogleChromeLabs
mohdsayed
@@ -0,0 +1,87 @@ +/* + * 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 className="w-1.5 h-1.5 text-gray-600 hover:text-gray-800 focus:outline-none ml-1" ```
ps-analysis-tool
github_2023
typescript
365
GoogleChromeLabs
mohdsayed
@@ -47,7 +47,13 @@ const TableBody = ({ const handleKeyDown = useCallback( (event: React.KeyboardEvent<HTMLDivElement>, index: number) => { - event.preventDefault(); + if ( + event.key !== 'Meta' && + event.key !== 'Control' && + event.key !== 'c' + ) { + event.preve...
```suggestion if (!['Meta', 'Control', 'c'].includes(event.key)) { event.preventDefault(); } ```
ps-analysis-tool
github_2023
typescript
407
GoogleChromeLabs
mohdsayed
@@ -18,22 +18,26 @@ */ import { Command } from 'commander'; import events from 'events'; -import { ensureFile, exists, readFile, writeFile } from 'fs-extra'; +import { ensureFile, writeFile } from 'fs-extra'; // @ts-ignore Package does not support typescript. import Spinnies from 'spinnies'; import { exec } from...
👍
ps-analysis-tool
github_2023
others
407
GoogleChromeLabs
mayan-000
@@ -6,7 +6,8 @@ "include": [ "src", "../../node_modules/@types/jest/index.d.ts", - "src/**/*.json" + "src/**/*.json", + "../common/src/utils/generateReports"
Seems an auto include, we can remove it.
ps-analysis-tool
github_2023
typescript
407
GoogleChromeLabs
mayan-000
@@ -380,22 +214,19 @@ const getUrlListFromArgs = async ( pageUrl: _url, technologyData: technologyAnalysisData ? technologyAnalysisData[ind] : [], cookieData: cookieAnalysisData[ind].cookieData, - }; + } as CompleteJson; }); - await ensureFile(outputDir + '/out.json'); - await writeFil...
Can we early return?
ps-analysis-tool
github_2023
typescript
407
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 ...
Can we break the processing of each arg into smaller functions inside the same file?
ps-analysis-tool
github_2023
typescript
407
GoogleChromeLabs
mayan-000
@@ -0,0 +1,111 @@ +/* + * 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 numArgs = [Boolean(url), Boolean(sitemapURL), Boolean(csvPath), Boolean(sitemapPath)].reduce((acc, arg) => { acc += arg ? 1 : 0; }, 0); if (numArgs === 0) { console.log( `Please provide one of the following a) URL of a site (-u or --url) b) URL of a site...
ps-analysis-tool
github_2023
others
211
GoogleChromeLabs
dhsathiya
@@ -0,0 +1,73 @@ +#!/bin/bash + +# Download Extension +extension_setup() { + ps_analysis_tool_version=v0.3.0 + 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...
@MiteshShah can you please add one liner before each chrome function for its purpose? e.g. line number [41](https://github.com/GoogleChromeLabs/ps-analysis-tool/pull/211/files#diff-89ef72b5c5b4c0decec968e6b38afaffaaabecc1db74269094fd8b0f65f84c51R41)
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.0
@MiteshShah 0.3.1 has been released, can we please change this to 0.3.1?