Skip to content

Commit 9f645e8

Browse files
authored
feat: Add data paragraph and uninstall button to consent page (#143)
More requirements for Mozilla. ![image](https://github.com/user-attachments/assets/be873790-f355-44f6-b2e0-3f6b64160116)
1 parent 6299734 commit 9f645e8

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

public/consent.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@
6666

6767
cursor: pointer;
6868
}
69+
70+
button#codecov-uninstall {
71+
background: white;
72+
border: 1px solid black;
73+
color: black;
74+
margin-left: 10px;
75+
}
6976
</style>
7077
</head>
7178
<body>
@@ -91,13 +98,20 @@ <h1>Codecov Browser Extension</h1>
9198
>privacy policy</a
9299
>.
93100
</p>
101+
<p>
102+
The Codecov extension may collect and use information from your browser
103+
such as your IP address and the URLs of the pages you access on
104+
https://github.com or on an enterprise version or self-hosted
105+
installation of Github you explicitly grant the extension access to.
106+
</p>
94107
<p>
95108
By clicking 'Accept', you confirm that you understand and agree to the
96109
privacy policy of the Codecov Browser Extension. Should you decide not
97110
to accept, please note that the extension will not work.
98111
</p>
99112
<br />
100113
<button id="codecov-consent-accept">Accept</button>
114+
<button id="codecov-uninstall">Uninstall</button>
101115
</div>
102116
</body>
103117
</html>

public/consent.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
document.addEventListener("DOMContentLoaded", function () {
2-
var button = document.getElementById("codecov-consent-accept");
3-
button.addEventListener("click", async function () {
2+
var consentButton = document.getElementById("codecov-consent-accept");
3+
consentButton.addEventListener("click", async function () {
44
const result = await browser.runtime.sendMessage({
55
type: "set_consent",
66
payload: true,
@@ -15,4 +15,20 @@ document.addEventListener("DOMContentLoaded", function () {
1515
);
1616
}
1717
});
18+
19+
var uninstallButton = document.getElementById("codecov-uninstall");
20+
uninstallButton.addEventListener("click", async function () {
21+
await browser.management
22+
.uninstallSelf()
23+
.then(() => {
24+
console.log("App uninstalled, closing tab");
25+
close();
26+
})
27+
.catch(() => {
28+
console.log(
29+
"Uninstall confirmation declined or something else went wrong."
30+
);
31+
close();
32+
});
33+
});
1834
});

0 commit comments

Comments
 (0)