Skip to content

Commit

Permalink
Show Google Sign-In breakage note always
Browse files Browse the repository at this point in the history
When accounts.google.com is blocked or cookieblocked by PB.
  • Loading branch information
lenacohen authored and ghostwords committed Nov 21, 2024
1 parent 0bf3880 commit 43ae667
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,6 @@ Badger.prototype = {
ignoredSiteBases: [],
nextPbconfigUpdateTime: 0,
showLearningPrompt: false,
shownBreakageNotes: [],
};
for (let key of Object.keys(privateDefaultSettings)) {
if (!privateStore.hasItem(key)) {
Expand Down Expand Up @@ -882,6 +881,7 @@ Badger.prototype = {
"legacyWebRtcProtectionUser",
"nextDntHashesUpdateTime",
"nextYellowlistUpdateTime",
"shownBreakageNotes",
"showWebRtcDeprecation",
].forEach(item => {
if (privateStore.hasItem(item)) { privateStore.deleteItem(item); }
Expand Down
14 changes: 2 additions & 12 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,6 @@ function createBreakageNote(domain, i18n_message_key) {
autoClose: false,
content: chrome.i18n.getMessage(i18n_message_key),
functionReady: function (tooltip) {
// record that this breakage note was shown
chrome.runtime.sendMessage({
type: "seenBreakageNote",
domain
});

// close on tooltip click/tap
$(tooltip.elementTooltip()).on('click', function (e) {
e.preventDefault();
Expand Down Expand Up @@ -641,8 +635,7 @@ function refreshPopup() {
(POPUP_DATA.settings.seenComic && !POPUP_DATA.showLearningPrompt && !POPUP_DATA.criticalError) &&
Object.keys(BREAKAGE_NOTE_DOMAINS).some(d => (
(POPUP_DATA.origins[d] == constants.BLOCK ||
POPUP_DATA.origins[d] == constants.COOKIEBLOCK) &&
!POPUP_DATA.shownBreakageNotes.includes(d)))
POPUP_DATA.origins[d] == constants.COOKIEBLOCK)))
) || (
POPUP_DATA.cookieblocked && Object.keys(POPUP_DATA.cookieblocked).some(
d => POPUP_DATA.origins[d] == constants.USER_BLOCK)
Expand Down Expand Up @@ -702,7 +695,6 @@ function refreshPopup() {
let show_breakage_note = false;
if (!show_breakage_warning) {
show_breakage_note = (utils.hasOwn(BREAKAGE_NOTE_DOMAINS, fqdn) &&
!POPUP_DATA.shownBreakageNotes.includes(fqdn) &&
(action == constants.BLOCK || action == constants.COOKIEBLOCK));
}
let slider_html = htmlUtils.getOriginHtml(fqdn, action,
Expand Down Expand Up @@ -793,9 +785,7 @@ function refreshPopup() {
$printable.find('.tooltip:not(.tooltipstered)').tooltipster(DOMAIN_TOOLTIP_CONF);
if ($printable.hasClass('breakage-note')) {
let domain = $printable[0].dataset.origin;
if (!POPUP_DATA.shownBreakageNotes.includes(domain)) {
createBreakageNote(domain, BREAKAGE_NOTE_DOMAINS[domain]);
}
createBreakageNote(domain, BREAKAGE_NOTE_DOMAINS[domain]);
}

if (printable.length) {
Expand Down
14 changes: 0 additions & 14 deletions src/js/webrequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,6 @@ function dispatcher(request, sender, sendResponse) {
origins: trackers,
settings: badger.getSettings().getItemClones(),
showLearningPrompt: badger.getPrivateSettings().getItem("showLearningPrompt"),
shownBreakageNotes: badger.getPrivateSettings().getItem("shownBreakageNotes"),
tabHost: tab_host,
tabId: tab_id,
tabUrl: request.tabUrl,
Expand Down Expand Up @@ -1546,19 +1545,6 @@ function dispatcher(request, sender, sendResponse) {
break;
}

case "seenBreakageNote": {
if (request.domain) {
let privateStore = badger.getPrivateSettings(),
shownBreakageNotes = privateStore.getItem("shownBreakageNotes");
if (!shownBreakageNotes.includes(request.domain)) {
shownBreakageNotes.push(request.domain);
}
badger.getPrivateSettings().setItem("shownBreakageNotes", shownBreakageNotes);
}
sendResponse();
break;
}

case "reenableOnSiteFromPopup": {
badger.reenableOnSite(request.tabHost);
badger.updateIcon(request.tabId, request.tabUrl);
Expand Down

0 comments on commit 43ae667

Please sign in to comment.