Skip to content

Commit

Permalink
Fix popup panel when embedded in logger
Browse files Browse the repository at this point in the history
Regression from commit:
0d77ccded7

Related feedback:
uBlockOrigin/uBlock-issues#2419 (reply in thread)
  • Loading branch information
gorhill committed Mar 17, 2024
1 parent 3f7374c commit 94de4e2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/js/popup-fenix.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ let cachedPopupHash = '';
const reCyrillicNonAmbiguous = /[\u0400-\u042b\u042d-\u042f\u0431\u0432\u0434\u0436-\u043d\u0442\u0444\u0446-\u0449\u044b-\u0454\u0457\u0459-\u0460\u0462-\u0474\u0476-\u04ba\u04bc\u04be-\u04ce\u04d0-\u0500\u0502-\u051a\u051c\u051e-\u052f]/;
const reCyrillicAmbiguous = /[\u042c\u0430\u0433\u0435\u043e\u043f\u0440\u0441\u0443\u0445\u044a\u0455\u0456\u0458\u0461\u0475\u04bb\u04bd\u04cf\u0501\u051b\u051d]/;

const hasOwnProperty = (o, p) =>
Object.prototype.hasOwnProperty.call(o, p);

/******************************************************************************/

const cachePopupData = function(data) {
Expand All @@ -88,7 +91,7 @@ const cachePopupData = function(data) {
return popupData;
}
for ( const hostname in hostnameDict ) {
if ( hostnameDict.hasOwnProperty(hostname) === false ) { continue; }
if ( hasOwnProperty(hostnameDict, hostname) === false ) { continue; }
let domain = hostnameDict[hostname].domain;
let prefix = hostname.slice(0, 0 - domain.length - 1);
// Prefix with space char for 1st-party hostnames: this ensure these
Expand Down Expand Up @@ -160,7 +163,7 @@ const formatNumber = function(count) {
});
if (
intl.resolvedOptions instanceof Function &&
intl.resolvedOptions().hasOwnProperty('notation')
hasOwnProperty(intl.resolvedOptions(), 'notation')
) {
intlNumberFormat = intl;
}
Expand Down Expand Up @@ -545,7 +548,7 @@ const renderPrivacyExposure = function() {
if ( des === '*' || desHostnameDone.has(des) ) { continue; }
const hnDetails = hostnameDict[des];
const { domain, counts } = hnDetails;
if ( allDomains.hasOwnProperty(domain) === false ) {
if ( hasOwnProperty(allDomains, domain) === false ) {
allDomains[domain] = false;
allDomainCount += 1;
}
Expand Down Expand Up @@ -1469,11 +1472,13 @@ const getPopupData = async function(tabId, first = false) {
return;
}
if ( selfURL.searchParams.get('portrait') !== null ) {
dom.cl.remove(dom.root, 'desktop');
dom.cl.add(dom.root, 'portrait');
return;
}
if ( popupData.popupPanelOrientation === 'landscape' ) { return; }
if ( popupData.popupPanelOrientation === 'portrait' ) {
dom.cl.remove(dom.root, 'desktop');
dom.cl.add(dom.root, 'portrait');
return;
}
Expand Down

0 comments on commit 94de4e2

Please sign in to comment.