File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
toolkit/components/cookiebanners Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -188,12 +188,17 @@ export class CookieBannerParent extends JSWindowActorParent {
188188 mode = perDomainMode ;
189189 }
190190 } catch ( e ) {
191- // getPerSitePref could throw with NS_ERROR_NOT_AVAILABLE if the service
192- // is disabled. We will fallback to global pref setting if any errors
193- // occur.
194- if ( e . result == Cr . NS_ERROR_NOT_AVAILABLE ) {
195- console . error ( "The cookie banner handling service is not available" ) ;
196- } else {
191+ // getDomainPref can throw in a few expected cases where we should
192+ // silently fall back to the global pref:
193+ // - NS_ERROR_NOT_AVAILABLE: service disabled.
194+ // - NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS: hosts like localhost, IPs,
195+ // or eTLDs without enough labels for a base domain.
196+ // - NS_ERROR_HOST_IS_IP_ADDRESS: IP literal hosts.
197+ if (
198+ e . result != Cr . NS_ERROR_NOT_AVAILABLE &&
199+ e . result != Cr . NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS &&
200+ e . result != Cr . NS_ERROR_HOST_IS_IP_ADDRESS
201+ ) {
197202 console . error ( "Fail on getting domain pref:" , e ) ;
198203 }
199204 }
You can’t perform that action at this time.
0 commit comments