Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.8.0 #662

Merged
merged 38 commits into from
May 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4e95ad5
fix: remove debug log statement (#633)
ayushnirwal Apr 19, 2024
2c21f44
Refactor: Update `Clear All` button render condition (#637)
mayan-000 Apr 26, 2024
ee42182
Fix: Broken download button icon (#636)
mayan-000 Apr 26, 2024
f918e3b
Update `babel-loader` webpack config to have caching support for fast…
gagan0123 Apr 26, 2024
1cf00de
Enhancement: CLI output path relative to "out" directory. (#638)
ayushnirwal Apr 26, 2024
e656db4
Refactor: Update `Known Breakages` component UI (#643)
mayan-000 Apr 29, 2024
994443b
Add comments
mohdsayed May 2, 2024
72e635f
Refactor code
mohdsayed May 2, 2024
8771d97
Fix wrong place of firing onErrorOccured. (#654)
amovar18 May 2, 2024
e32e084
Update Privacy Sandbox timeline icon (#649)
mayan-000 May 2, 2024
d9c0a35
Update landing pages UI (#659)
mayan-000 May 5, 2024
fc3b0c6
Remove exclude from audits exclusion reason. (#658)
amovar18 May 5, 2024
a5561ab
Fix: Revise method to keep service worker alive. (#655)
amovar18 May 5, 2024
d1d38c4
Fix: Merge blocked reasons data in dashboard (#650)
mayan-000 May 5, 2024
bac4d89
Fix error and remove deadcode from codebase.
amovar18 May 6, 2024
8554f74
Fix disconnection and connection for serviceworker port.
amovar18 May 6, 2024
07ca2d5
Fix `portRef` error.
amovar18 May 6, 2024
d889601
Fix `portRef` error.
amovar18 May 6, 2024
ac64fde
Miscellaneous CLI dashboard changes (#660)
mayan-000 May 7, 2024
795362f
Update can-i-use
mohdsayed May 7, 2024
5624427
Add UTM params to links
mohdsayed May 7, 2024
fafd8d3
Add readiness content (#663)
mayan-000 May 7, 2024
fd6d9d3
Feature: Add HTML report generation to CLI dashboard and CLI (#646)
ayushnirwal May 7, 2024
7b4c302
Update changelog
mohdsayed May 7, 2024
c45d739
Merge latest main
mohdsayed May 7, 2024
3a1e758
Bump version to v0.8.0
mohdsayed May 7, 2024
67472b8
Fix: Retention period cookie filter (#665)
mayan-000 May 7, 2024
08abbce
Fetch Chrome launcher script from `main` instead of `develop` branch …
gagan0123 May 7, 2024
55ffd61
Fix: Errors appearing on extension page (#668)
amovar18 May 7, 2024
af09e4a
Move section to top and rename heading (#669)
mayan-000 May 8, 2024
c8a2d04
Remove `reCaptcha` from library detection (#670)
mayan-000 May 8, 2024
872ebfc
Fix zero cookie issue. (#671)
amovar18 May 8, 2024
7453d24
Fix: Map exclusion reason to cookie blocked reason. (#673)
amovar18 May 8, 2024
5c28020
Enhancement: HTML report (#672)
ayushnirwal May 8, 2024
914f0ff
Update RWS JSON before release
gagan0123 May 8, 2024
1e21668
Merge pull request #675 from GoogleChromeLabs/chore/rws-json-update
gagan0123 May 8, 2024
1471df0
Update open cookie DB.
amovar18 May 8, 2024
f6ca935
Use await in chrome.storage.local.get.
amovar18 May 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use await in chrome.storage.local.get.
Call open cookie database only once.
amovar18 committed May 9, 2024

Verified

This commit was signed with the committer’s verified signature.
amovar18 Kudaligi Amoghavarsha
commit f6ca935176f25daddd93cda9e0021640611b360f
23 changes: 1 addition & 22 deletions packages/extension/src/contentScript/index.ts
Original file line number Diff line number Diff line change
@@ -41,7 +41,6 @@ import { TOOLTIP_CLASS } from './constants';
import {
DEVTOOLS_SET_JAVASCSCRIPT_COOKIE,
GET_JS_COOKIES,
SERVICE_WORKER_PORT_NAME,
TABID_STORAGE,
WEBPAGE_PORT_NAME,
} from '../constants';
@@ -63,11 +62,6 @@ class WebpageContentScript {
*/
port: chrome.runtime.Port | null = null;

/**
* Serviceeworker Connection port
*/
serviceWorkerPort: chrome.runtime.Port | null = null;

/**
* TabId of the current Tab
*/
@@ -158,13 +152,6 @@ class WebpageContentScript {

if (message?.payload?.type === TABID_STORAGE) {
this.tabId = message.payload.tabId;
chrome.runtime.sendMessage({
setInPage: true,
type: 'PING',
payload: {
tabId: this.tabId,
},
});
}

if (message?.payload?.type === GET_JS_COOKIES) {
@@ -182,13 +169,6 @@ class WebpageContentScript {
port.onMessage.addListener(this.onMessage);
port.onDisconnect.addListener(this.onDisconnect);
}
if (port.name.startsWith(SERVICE_WORKER_PORT_NAME)) {
this.serviceWorkerPort = port;
this.serviceWorkerPort.onMessage.addListener(noop);
this.serviceWorkerPort.onDisconnect.addListener(() => {
this.serviceWorkerPort = null;
});
}
});
}

@@ -204,6 +184,7 @@ class WebpageContentScript {
tabUrl: window.location.href,
tabId,
documentCookies: jsCookies,
cookieDB: this.cookieDB ?? {},
});
} catch (error) {
//Fail silently. No logging because sometimes cookieStore.getAll fails to run in some context.
@@ -319,8 +300,6 @@ class WebpageContentScript {
setInPage: false,
});
}
this.serviceWorkerPort?.disconnect();
this.serviceWorkerPort = null;
}

/**
41 changes: 8 additions & 33 deletions packages/extension/src/serviceWorker/index.ts
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@ import {
INITIAL_SYNC,
POPUP_CLOSE,
POPUP_OPEN,
SERVICE_WORKER_PORT_NAME,
SERVICE_WORKER_RELOAD_MESSAGE,
SERVICE_WORKER_TABS_RELOAD_COMMAND,
SET_TAB_TO_READ,
@@ -165,6 +164,10 @@ chrome.webRequest.onBeforeSendHeaders.addListener(
* @see https://developer.chrome.com/docs/extensions/reference/api/runtime#event-onStartup
*/
chrome.runtime.onStartup.addListener(async () => {
setInterval(async () => {
await chrome.storage.session.get();
}, 20000);

const storage = await chrome.storage.sync.get();

if (!syncCookieStore) {
@@ -293,6 +296,10 @@ chrome.runtime.onInstalled.addListener(async (details) => {
syncCookieStore = new SynchnorousCookieStore();
syncCookieStore?.clear();

setInterval(async () => {
await chrome.storage.session.get();
}, 20000);

if (details.reason === 'install') {
await chrome.storage.sync.clear();
await chrome.storage.sync.set({
@@ -606,38 +613,6 @@ chrome.runtime.onMessage.addListener(async (request) => {

const incomingMessageTabId = request.payload.tabId;

if ('PING' === request?.type) {
if (syncCookieStore && syncCookieStore?.tabs[incomingMessageTabId]) {
if (!syncCookieStore?.tabs[incomingMessageTabId]?.portRef) {
syncCookieStore.tabs[incomingMessageTabId].portRef =
chrome.tabs.connect(Number(incomingMessageTabId), {
name: `${SERVICE_WORKER_PORT_NAME}-${incomingMessageTabId}`,
});
}

if (syncCookieStore?.tabs[incomingMessageTabId]?.portRef) {
setInterval(() => {
syncCookieStore?.tabs[incomingMessageTabId]?.portRef?.postMessage({
status: 'ping',
});
}, 10000);
}

syncCookieStore?.tabs[
incomingMessageTabId
]?.portRef.onDisconnect.addListener(() => {
if (
syncCookieStore &&
syncCookieStore?.tabs[incomingMessageTabId]?.portRef
) {
syncCookieStore.tabs[incomingMessageTabId].portRef = null;
}

clearInterval(10000);
});
}
}

if (DEVTOOLS_OPEN === incomingMessageType) {
const dataToSend: { [key: string]: string | boolean } = {};
dataToSend['tabMode'] = tabMode;
Original file line number Diff line number Diff line change
@@ -20,30 +20,31 @@ import {
isFirstParty,
findAnalyticsMatch,
type CookieData,
type CookieDatabase,
} from '@ps-analysis-tool/common';
import { type Cookie as ParsedCookie } from 'simple-cookie';

/**
* Internal dependencies.
*/
import { createCookieObject } from '../serviceWorker/createCookieObject';
import { fetchDictionary } from './fetchCookieDictionary';

import { GET_JS_COOKIES } from '../constants';

interface ProcessAndStoreDucmentCookies {
tabUrl: string;
tabId: string;
documentCookies: ParsedCookie[];
cookieDB: CookieDatabase;
}

const processAndStoreDocumentCookies = async ({
tabUrl,
tabId,
documentCookies,
cookieDB,
}: ProcessAndStoreDucmentCookies) => {
try {
const cookieDB = await fetchDictionary();

const parsedCookieData: CookieData[] = documentCookies.map(
(singleCookie: ParsedCookie) => {
let parsedCookie = {
Loading