Skip to content

Commit 6aed323

Browse files
committed
Premium prompts now link to /pricing, instead of the in-popup pricing section
1 parent 2e242cf commit 6aed323

File tree

2 files changed

+13
-43
lines changed

2 files changed

+13
-43
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "DocDecoder - Summarize Web Policies With AI",
44
"description": "DocDecoder uses GPT-4 to generate clear, concise summaries of any site's legal policies for you to skim over before you accept them.",
5-
"version": "1.2.0",
5+
"version": "1.2.1",
66
"action": {
77
"default_popup": "popup.html",
88
"default_icon": {

popup.js

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,8 @@ document.addEventListener('DOMContentLoaded', function () {
268268
});
269269

270270
document.getElementById('upgrade-btn').addEventListener('click', function () {
271-
document.getElementById('plan-info').style.display = 'none';
272-
document.getElementById('premium-container').style.display = 'block';
273-
document.getElementById('exit-premium-container-tomain').style.display = 'none';
274-
document.getElementById('exit-premium-container-toacct').style.display = 'block';
275-
276-
var aiGif = document.getElementById('ai-gif');
277-
aiGif.src = aiGif.dataset.src;
271+
// open a new tab for the pricing page
272+
chrome.tabs.create({ url: 'https://docdecoder.app/pricing' });
278273
});
279274

280275
document.getElementById("exit-premium-container-toacct").addEventListener("click", function () {
@@ -328,25 +323,15 @@ document.addEventListener('DOMContentLoaded', function () {
328323
rateLimitMessage.querySelector('p').innerHTML = data.rateLimitExceeded;
329324
chrome.storage.local.remove('rateLimitExceeded');
330325
document.getElementById('premium-subscribe-txt-sums').addEventListener('click', function () {
331-
document.getElementById('main-extension-content').style.display = 'none';
332-
document.getElementById('premium-container').style.display = 'block';
333-
document.getElementById('exit-premium-container-tomain').style.display = 'block';
334-
document.getElementById('exit-premium-container-toacct').style.display = 'none';
335-
336-
var aiGif = document.getElementById('ai-gif');
337-
aiGif.src = aiGif.dataset.src;
326+
// open a new tab for the pricing page
327+
chrome.tabs.create({ url: 'https://docdecoder.app/pricing' });
338328
});
339329
}
340330
});
341331

342332
document.getElementById('premium-button').addEventListener('click', function() {
343-
document.getElementById('main-extension-content').style.display = 'none';
344-
document.getElementById('premium-container').style.display = 'block';
345-
document.getElementById('exit-premium-container-tomain').style.display = 'block';
346-
document.getElementById('exit-premium-container-toacct').style.display = 'none';
347-
348-
var aiGif = document.getElementById('ai-gif');
349-
aiGif.src = aiGif.dataset.src;
333+
// open a new tab for the pricing page
334+
chrome.tabs.create({ url: 'https://docdecoder.app/pricing' });
350335
});
351336

352337
document.getElementById('exit-premium-container-tomain').addEventListener('click', function () {
@@ -361,23 +346,13 @@ document.addEventListener('DOMContentLoaded', function () {
361346
const upgradePremiumTxt = document.getElementById('upgrade-premium-txt');
362347
const upgradePremiumLink = upgradePremiumTxt.querySelector('a');
363348
upgradePremiumLink.addEventListener('click', function () {
364-
document.getElementById('plan-info').style.display = 'none';
365-
document.getElementById('premium-container').style.display = 'block';
366-
document.getElementById('exit-premium-container-tomain').style.display = 'none';
367-
document.getElementById('exit-premium-container-toacct').style.display = 'block';
368-
369-
var aiGif = document.getElementById('ai-gif');
370-
aiGif.src = aiGif.dataset.src;
349+
// open a new tab for the pricing page
350+
chrome.tabs.create({ url: 'https://docdecoder.app/pricing' });
371351
});
372352

373353
document.getElementById('premium-subscribe-txt').addEventListener('click', function () {
374-
document.getElementById('main-extension-content').style.display = 'none';
375-
document.getElementById('premium-container').style.display = 'block';
376-
document.getElementById('exit-premium-container-tomain').style.display = 'block';
377-
document.getElementById('exit-premium-container-toacct').style.display = 'none';
378-
379-
var aiGif = document.getElementById('ai-gif');
380-
aiGif.src = aiGif.dataset.src;
354+
// open a new tab for the pricing page
355+
chrome.tabs.create({ url: 'https://docdecoder.app/pricing' });
381356
});
382357

383358
document.getElementById('close-intro').addEventListener('click', function () {
@@ -857,13 +832,8 @@ function initPopup() {
857832

858833
if (domainErrors[termType] && domainErrors[termType].includes("premium-subscribe-txt-sums")) {
859834
document.getElementById('premium-subscribe-txt-sums').addEventListener('click', function () {
860-
document.getElementById('main-extension-content').style.display = 'none';
861-
document.getElementById('premium-container').style.display = 'block';
862-
document.getElementById('exit-premium-container-tomain').style.display = 'block';
863-
document.getElementById('exit-premium-container-toacct').style.display = 'none';
864-
865-
var aiGif = document.getElementById('ai-gif');
866-
aiGif.src = aiGif.dataset.src;
835+
// open a new tab for the pricing page
836+
chrome.tabs.create({ url: 'https://docdecoder.app/pricing' });
867837
});
868838
}
869839

0 commit comments

Comments
 (0)