Skip to content

Commit

Permalink
Merge pull request #480 from privacy-tech-lab/issue-479
Browse files Browse the repository at this point in the history
1.0.1 Release
  • Loading branch information
lr-brown authored Mar 5, 2023
2 parents 3fa42ef + 6ea0e5b commit 39e542f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 93 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "privacy-pioneer",
"version": "1.0.0",
"version": "1.0.1",
"jest": {
"setupFiles": [
"fake-indexeddb/auto",
Expand Down
8 changes: 0 additions & 8 deletions src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,6 @@ importData().then((data) => {

runNotifications();

browser.runtime.onInstalled.addListener((details) => {
console.log("HI")
if (details.reason === "install") {
console.log('Addon Installed')
browser.tabs.create({ url: browser.runtime.getURL("options.html") });
}
})

// Listener to get response data, request body, and details about request
browser.webRequest.onBeforeRequest.addListener(
async function (details) {
Expand Down
58 changes: 5 additions & 53 deletions src/libs/components/label-detail/components/evidence/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,49 +67,6 @@ const Evidence = ({ collapseId, request, label, type }) => {
}
};

/**
* Get sub label general description
* @param {object} request our evidence object for this request
* @returns {object} sliced general description of our reasonings for our labels | ""
*/
const getGeneralDescription = (request) => {
if (request != null) {
let generalDescriptionParsed = {
leading: "",
highlight: "",
trailing: "",
};
const displayType = privacyLabels[label]["types"][type]["displayName"];
const generalDescription =
privacyLabels[label]["types"][type]["description"];

// we want to highlight the label type in the description
let highlight = generalDescription.indexOf(displayType);
if (displayType == "Encoded Email") {
generalDescriptionParsed.leading = "‣ ".concat(
generalDescription.slice(0, 3)
);
generalDescriptionParsed.highlight = "Email Address";
generalDescriptionParsed.trailing = generalDescription.slice(
16,
generalDescription.length
);
} else if (highlight == -1) {
generalDescriptionParsed.leading = "‣ ".concat(generalDescription);
} else {
generalDescriptionParsed.leading = "‣ ".concat(
generalDescription.slice(0, highlight)
);
generalDescriptionParsed.highlight = displayType;
generalDescriptionParsed.trailing = generalDescription.slice(
highlight + displayType.length,
generalDescription.length
);
}
return generalDescriptionParsed;
}
return "";
};

const [handEmoji, setHandEmoji] = useState("");

Expand Down Expand Up @@ -167,7 +124,7 @@ const Evidence = ({ collapseId, request, label, type }) => {

// description for when evidence came from a list of URL's (disconnect or urlClassification header)
if (request.index == -1) {
specificDescription.leading = `‣ The URL that initiated this HTTP request is known to practice `;
specificDescription.leading = `‣ The URL that initiated this web request is known to practice `;
specificDescription.highlight = `${displayType}`;
specificDescription.trailing = `.`;
}
Expand All @@ -193,16 +150,16 @@ const Evidence = ({ collapseId, request, label, type }) => {
if (request.permission == "location"){
specificDescription.trailing = ` (your ${displayType}) in this web request.`;
}
else if(displayType == "IP Address"){
specificDescription.trailing = ` (an ${displayType}) in this HTTP request.`;
else if (displayType == "IP Address"){
specificDescription.trailing = ` (an ${displayType}) in this web request.`;
}
else {
specificDescription.trailing = ` (a ${displayType}) in this HTTP request.`;
specificDescription.trailing = ` (a ${displayType}) in this web request.`;
}
}
// specific encoded email case
else {
specificDescription.trailing = ` in this HTTP request, which is the encoded form of `;
specificDescription.trailing = ` in this web request, which is the encoded form of `;
specificDescription.email = `${request.extraDetail}`;
specificDescription.trail1 = ` from your watchlist, so we gave it the `;
specificDescription.encodedEmail = `${displayType}`;
Expand All @@ -215,7 +172,6 @@ const Evidence = ({ collapseId, request, label, type }) => {
};

const specificDescription = getSpecificDescription(request);
const generalDescription = getGeneralDescription(request);
const data = getSnippet(request);

return (
Expand All @@ -224,10 +180,6 @@ const Evidence = ({ collapseId, request, label, type }) => {
<SHeader marginTop="16px">◉ Description</SHeader>
<SEvidenceDescription>
<pre>
{generalDescription.leading}
<span>{generalDescription.highlight}</span>
{generalDescription.trailing}
<br></br>
{specificDescription.leading}
<span>{specificDescription.highlight}</span>
{specificDescription.trailing}
Expand Down
27 changes: 11 additions & 16 deletions src/libs/components/label-detail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,21 @@ const LabelDetail = ({ label, website, requests }) => {
* Get first party description based on whether 'website' collected data
*/
const firstPartyDescription = () => {
if (collected) {
return `Collected the following ${label} data:`;
} else {
return `Did not collect ${label} data.`;
}
};

/**
* Get third party description based on whether 'website' shared data
*/
const thirdPartyDescription = () => {
if (collected && urls.length === 1) {
return `${website} did not share ${label} data.`;
} else {
return `${website} shared ${label} data with the following third parties:`;
return `${website} collected the following ${label} data:`;
}
else if (collected && urls.length > 1) {
return `${website} collected and shared the following ${label} data:`;
}
else if (!collected && urls.length > 1) {
return `${website} shared the following ${label} data:`;
}
else {
return `Did not collect or share ${label} data.`;
}
};


return (
<SBody>
<SHeader>
Expand All @@ -65,10 +62,8 @@ const LabelDetail = ({ label, website, requests }) => {
) : null}
</SContent>
</SHeader>
<SSeperator marginLeft="16px" marginRight="16px" />
<SThirdParty>
<STitle>Third Parties</STitle>
<SDescription>{thirdPartyDescription()} </SDescription>
{Object.entries(requests).map(([url, request]) => {
if (url !== website)
return (
Expand Down
3 changes: 1 addition & 2 deletions src/libs/components/label-detail/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const SHeaderBadge = styled.div`
display: flex;
flex-direction: row;
align-items: center;
margin-top: 16px;
`;

export const SHeader = styled.div`
Expand All @@ -40,7 +39,7 @@ export const STitle = styled.div`
export const SDescription = styled.div`
margin-top: 8px;
color: var(--secondaryTextColor);
font-size: var(--body2);
font-size: var(--body1);
`;

export const SThirdParty = styled.div`
Expand Down
17 changes: 5 additions & 12 deletions src/libs/icons/company-icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,11 @@ export const Verizon = ({ size }) => (
// );

export const Yandex = ({ size }) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 36 66"
fill="#fff"
fillRule="evenodd"
stroke="#000"
strokeLinecap="round"
strokeLinejoin="round"
height={size}
width={size}
>
<path d="M34.451 0c.524.405.262.88.095 1.333l-6.643 18.095-8.047 22.12a4.21 4.21 0 0 0-.262 1.429v19.8c0 1.2-.024 1.2-1.214 1.2-1.238 0-2.476-.048-3.714.024-.786.024-1.07-.238-1.048-1.024l.024-7.333V42.928c0-.5-.07-1.048-.262-1.524L.357 7.333C.262 7.071.119 6.857 0 6.619v-.5c.38-.12.762-.3 1.143-.3l4.12-.024s1.357 0 1.8 1.286l9.7 27.3.405.976.333-1.095 1.905-6.976 8.5-26.3c.12-.333.405-.62.62-.93L34.451 0z" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 32 32" width="32px"
height="32px">
<path d="M 20.800781 1 L 15.199219 17.199219 L 10.199219 4 L 7 4 L 14 22.599609 L 14 31 L 17 31 L 17 21.099609 L 24 1 L 20.800781 1 z"/>
</svg>
);

Expand Down
1 change: 1 addition & 0 deletions src/libs/indexed-db/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const setDefaultSettings = async () => {
await settingsKeyval.set(settingsModelsEnum.optimizePerformance, true);
await settingsKeyval.set(settingsModelsEnum.extensionEnabled, true);
await analyticsKeyval.set(settingsModelsEnum.analytics, true);
browser.tabs.create({ url: browser.runtime.getURL("options.html") });
}

loadModel();
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "privacy-pioneer",
"version": "1.0.0",
"version": "1.0.1",
"permissions": [
"webRequest",
"<all_urls>",
Expand Down

0 comments on commit 39e542f

Please sign in to comment.