From c28568f9b0f7082ca2131e3a77065800773b79b7 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 1 Mar 2015 17:25:48 -0500 Subject: [PATCH] support 2-letter hostname, for when using TLD alone --- src/js/background.js | 2 +- src/js/start.js | 4 ++-- src/js/static-net-filtering.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index aa8033fad..9d84845ea 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -85,7 +85,7 @@ return { // read-only systemSettings: { - compiledMagic: 'iolkecdtfsiy', + compiledMagic: 'umxqgjonkvtf', selfieMagic: 'spqmeuaftfra' }, diff --git a/src/js/start.js b/src/js/start.js index de71253bb..bca966bb0 100644 --- a/src/js/start.js +++ b/src/js/start.js @@ -158,11 +158,11 @@ var onSystemSettingsReady = function(fetched) { mustSaveSystemSettings = true; } if ( fetched.selfieMagic !== µb.systemSettings.selfieMagic ) { - fetched.selfie = null; - µb.destroySelfie(); mustSaveSystemSettings = true; } if ( mustSaveSystemSettings ) { + fetched.selfie = null; + µb.destroySelfie(); vAPI.storage.set(µb.systemSettings, µb.noopFunc); } }; diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index 792d130d4..d9eb6b638 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -19,8 +19,8 @@ Home: https://github.com/gorhill/uBlock */ -/* jshint bitwise: false, esnext: true */ -/* global µBlock */ +/* jshint bitwise: false, esnext: true, boss: true */ +/* global punycode, µBlock */ // Older Safari throws an exception for const when it's used with 'use strict'. // 'use strict'; @@ -88,7 +88,7 @@ const AllowAnyTypeAnyParty = AllowAction | AnyType | AnyParty; const AllowAnyType = AllowAction | AnyType; const AllowAnyParty = AllowAction | AnyParty; -var reHostnameRule = /^[0-9a-z][0-9a-z.-]+[0-9a-z]$/; +var reHostnameRule = /^[0-9a-z][0-9a-z.-]*[0-9a-z]$/; var reHostnameToken = /^[0-9a-z]+/g; var reGoodToken = /[%0-9a-z]{2,}/g; var reURLPostHostnameAnchors = /[\/?#]/;