mirror of https://github.com/gorhill/uBlock.git
Merge pull request #1335 from gorhill/chrisaljoudi
https://github.com/gorhill/uBlock/issues/150 + other fix re. tab-binding
This commit is contained in:
commit
84f974766e
|
@ -0,0 +1,49 @@
|
||||||
|
In effisjnte adblocker: brûkt hast gjin prosessorkrêft en ûnthâld. Dochs kin it tûzenen filters mear lade en tapasse as oare populêre adblockers.
|
||||||
|
|
||||||
|
Yllustrearre effisjinsjefergeliking: https://github.com/chrisaljoudi/uBlock/wiki/uBlock-vs.-ABP:-efficiency-compared
|
||||||
|
|
||||||
|
Gebrûk: Mei de grutte oan-útknop yn de pop-up kin uBlock permanint yn- of útskeakele wurde foar de aktuele website. It wurdt inkeld op de aktuele website tapast. It is gjin globale oan-útknop.
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
Fleksibel, want it is mear as in "adblocker": it kin ek filters ynlêze en meitsje fan hostsbestannen.
|
||||||
|
|
||||||
|
Standert wurde de folgjende filterlisten laden en tapast:
|
||||||
|
|
||||||
|
- EasyList
|
||||||
|
- Peter Lowe’s Ad server list
|
||||||
|
- EasyPrivacy
|
||||||
|
- Malware domains
|
||||||
|
|
||||||
|
Der binne mear listen beskikber dy't jo ynskeakelje kin:
|
||||||
|
|
||||||
|
- Fanboy’s Enhanced Tracking List
|
||||||
|
- Dan Pollock’s hosts file
|
||||||
|
- hpHosts’s Ad and tracking servers
|
||||||
|
- MVPS HOSTS
|
||||||
|
- Spam404
|
||||||
|
- En in protte mear
|
||||||
|
|
||||||
|
Natuerlik wurdt it ûnthâldgebrûk grutter as der mear filters ynskeakele wurde. Mar sels nei it ynskeakeljen fan Fanboy's twa ekstra listen, hpHosts’s Ad en tracking servers, hat uBlock in leger ûnthâldgebrûk as oare populêre blockers.
|
||||||
|
|
||||||
|
Let op, it gebrûk fan guon fan dizze ekstra listen ferheget de kâns dat websites net korrekt werjûn wurde -- seker de listen dy't normaal as hosts-bestân brûkt wurde.
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
Sûnder de standert filterlist docht dizze add-on neat. Dus as jo ea echt in bydrage leverje wolle, tink dan oan de minsken dy't hurd wurkje om de filterlisten dy't jo brûke te ûnderhâlden, hokker allegearre fergees beskikber makke binne.
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
Fergees.
|
||||||
|
Open source mei publike lisinsje (GPLv3)
|
||||||
|
Foar brûkers, troch brûkers.
|
||||||
|
|
||||||
|
Meiwurkers @ Github: https://github.com/chrisaljoudi/uBlock/graphs/contributors
|
||||||
|
Meiwurkers @ Crowdin: https://crowdin.net/project/ublock
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
Unthâld dat dit in hiele betide ferzje is as jo kommentaar leverje.
|
||||||
|
|
||||||
|
Projektwizigingslochboek:
|
||||||
|
https://github.com/chrisaljoudi/uBlock/releases
|
|
@ -168,9 +168,6 @@ const contentObserver = {
|
||||||
type: type,
|
type: type,
|
||||||
url: location.spec
|
url: location.spec
|
||||||
};
|
};
|
||||||
if ( type === 7 ) {
|
|
||||||
details.attrSrc = context.frameElement.getAttribute('src');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( typeof messageManager.sendRpcMessage === 'function' ) {
|
if ( typeof messageManager.sendRpcMessage === 'function' ) {
|
||||||
// https://bugzil.la/1092216
|
// https://bugzil.la/1092216
|
||||||
|
|
|
@ -1334,9 +1334,6 @@ vAPI.net.registerListeners = function() {
|
||||||
type: details.type,
|
type: details.type,
|
||||||
url: details.url
|
url: details.url
|
||||||
};
|
};
|
||||||
if ( details.attrSrc !== undefined ) {
|
|
||||||
lastRequest[0].attrSrc = details.attrSrc;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
vAPI.messaging.globalMessageManager.addMessageListener(
|
vAPI.messaging.globalMessageManager.addMessageListener(
|
||||||
|
@ -2176,7 +2173,7 @@ vAPI.onLoadAllCompleted = function() {
|
||||||
|
|
||||||
var tabId = this.tabs.getTabId(tab);
|
var tabId = this.tabs.getTabId(tab);
|
||||||
var browser = getBrowserForTab(tab);
|
var browser = getBrowserForTab(tab);
|
||||||
µb.tabContextManager.commit(tabId, browser.currentURI.asciiSpec);
|
µb.tabContextManager.commit(tabId);
|
||||||
µb.bindTabToPageStats(tabId, browser.currentURI.asciiSpec);
|
µb.bindTabToPageStats(tabId, browser.currentURI.asciiSpec);
|
||||||
browser.messageManager.sendAsyncMessage(
|
browser.messageManager.sendAsyncMessage(
|
||||||
location.host + '-load-completed'
|
location.host + '-load-completed'
|
||||||
|
|
|
@ -0,0 +1,530 @@
|
||||||
|
{
|
||||||
|
"extName":{
|
||||||
|
"message":"uBlock",
|
||||||
|
"description":"extension name."
|
||||||
|
},
|
||||||
|
"extShortDesc":{
|
||||||
|
"message":"Einlik, in effisjinte adblocker. Brûkt hast gjin prosessorkrêft of ûnthâld.",
|
||||||
|
"description":"this will be in the chrome web store: must be 132 characters or less"
|
||||||
|
},
|
||||||
|
"dashboardName":{
|
||||||
|
"message":"uBlock — Dashboerd",
|
||||||
|
"description":"English: uBlock — Dashboard"
|
||||||
|
},
|
||||||
|
"settingsPageName":{
|
||||||
|
"message":"Ynstellingen",
|
||||||
|
"description":"appears as tab name in dashboard"
|
||||||
|
},
|
||||||
|
"3pPageName":{
|
||||||
|
"message":"Filters fan tredden",
|
||||||
|
"description":"appears as tab name in dashboard"
|
||||||
|
},
|
||||||
|
"1pPageName":{
|
||||||
|
"message":"Myn filters",
|
||||||
|
"description":"appears as tab name in dashboard"
|
||||||
|
},
|
||||||
|
"rulesPageName":{
|
||||||
|
"message":"Myn rigels",
|
||||||
|
"description":"appears as tab name in dashboard"
|
||||||
|
},
|
||||||
|
"whitelistPageName":{
|
||||||
|
"message":"Whitelist",
|
||||||
|
"description":"appears as tab name in dashboard"
|
||||||
|
},
|
||||||
|
"statsPageName":{
|
||||||
|
"message":"uBlock — Netwurkfersiken-lochboek",
|
||||||
|
"description":"Title for the network request log window"
|
||||||
|
},
|
||||||
|
"aboutPageName":{
|
||||||
|
"message":"Oer",
|
||||||
|
"description":"appears as tab name in dashboard"
|
||||||
|
},
|
||||||
|
"popupPowerSwitchInfo":{
|
||||||
|
"message":"Klikke: uBlock foar dizze website yn-\/útskeakelje.\n\nCtrl+klikke: uBlock inkeld foar dizze side útskeakelje.",
|
||||||
|
"description":"English: Click: disable\/enable uBlock for this site.\n\nCtrl+click: disable uBlock only on this page."
|
||||||
|
},
|
||||||
|
"popupBlockedRequestPrompt":{
|
||||||
|
"message":"blokkearre fersiken",
|
||||||
|
"description":"English: requests blocked"
|
||||||
|
},
|
||||||
|
"popupBlockedOnThisPagePrompt":{
|
||||||
|
"message":"op dizze side",
|
||||||
|
"description":"English: on this page"
|
||||||
|
},
|
||||||
|
"popupBlockedStats":{
|
||||||
|
"message":"{{count}} fan {{percent}}%",
|
||||||
|
"description":"Example: 15 or 13%"
|
||||||
|
},
|
||||||
|
"popupBlockedSinceInstallPrompt":{
|
||||||
|
"message":"sûnt ynstallaasje",
|
||||||
|
"description":"English: since install"
|
||||||
|
},
|
||||||
|
"popupOr":{
|
||||||
|
"message":"of",
|
||||||
|
"description":"English: or"
|
||||||
|
},
|
||||||
|
"popupTipDashboard":{
|
||||||
|
"message":"Klik om it dashboerd te iepenjen",
|
||||||
|
"description":"English: Click to open the dashboard"
|
||||||
|
},
|
||||||
|
"popupTipPicker":{
|
||||||
|
"message":"Elemintkiesmoadus iepenje",
|
||||||
|
"description":"English: Enter element picker mode"
|
||||||
|
},
|
||||||
|
"popupTipLog":{
|
||||||
|
"message":"Nei fersikenlochboek gean",
|
||||||
|
"description":"English: Go to request log"
|
||||||
|
},
|
||||||
|
"popupTipNoPopups":{
|
||||||
|
"message":"Alle pop-ups foar dizze website yn-\/útskeakelje",
|
||||||
|
"description":"English: Toggle the blocking of all popups for this site"
|
||||||
|
},
|
||||||
|
"popupTipNoStrictBlocking":{
|
||||||
|
"message":"Strikte blokkearring foar dizze website yn-\/útskeakelje",
|
||||||
|
"description":"English: Toggle strict blocking for this site"
|
||||||
|
},
|
||||||
|
"popupAnyRulePrompt":{
|
||||||
|
"message":"alles",
|
||||||
|
"description":""
|
||||||
|
},
|
||||||
|
"popupImageRulePrompt":{
|
||||||
|
"message":"ôfbyldingen",
|
||||||
|
"description":""
|
||||||
|
},
|
||||||
|
"popup3pAnyRulePrompt":{
|
||||||
|
"message":"fan tredden",
|
||||||
|
"description":""
|
||||||
|
},
|
||||||
|
"popupInlineScriptRulePrompt":{
|
||||||
|
"message":"inline scripts",
|
||||||
|
"description":""
|
||||||
|
},
|
||||||
|
"popup1pScriptRulePrompt":{
|
||||||
|
"message":"scripts fan de sites sels",
|
||||||
|
"description":""
|
||||||
|
},
|
||||||
|
"popup3pScriptRulePrompt":{
|
||||||
|
"message":"scripts fan tredden",
|
||||||
|
"description":""
|
||||||
|
},
|
||||||
|
"popup3pFrameRulePrompt":{
|
||||||
|
"message":"frames fan tredden",
|
||||||
|
"description":""
|
||||||
|
},
|
||||||
|
"popupHitDomainCountPrompt":{
|
||||||
|
"message":"ferbûne domeinen",
|
||||||
|
"description":"appears in popup"
|
||||||
|
},
|
||||||
|
"popupHitDomainCount":{
|
||||||
|
"message":"{{count}} fan de {{total}}",
|
||||||
|
"description":"appears in popup"
|
||||||
|
},
|
||||||
|
"pickerCreate":{
|
||||||
|
"message":"Meitsje",
|
||||||
|
"description":"English: Create"
|
||||||
|
},
|
||||||
|
"pickerPick":{
|
||||||
|
"message":"Kieze",
|
||||||
|
"description":"English: Pick"
|
||||||
|
},
|
||||||
|
"pickerQuit":{
|
||||||
|
"message":"Slute",
|
||||||
|
"description":"English: Quit"
|
||||||
|
},
|
||||||
|
"pickerNetFilters":{
|
||||||
|
"message":"Netfilters",
|
||||||
|
"description":"English: Net filters"
|
||||||
|
},
|
||||||
|
"pickerCosmeticFilters":{
|
||||||
|
"message":"Kosmetyske filters",
|
||||||
|
"description":"English: Cosmetic filters"
|
||||||
|
},
|
||||||
|
"pickerCosmeticFiltersHint":{
|
||||||
|
"message":"Klik, Ctrl-klik",
|
||||||
|
"description":"English: Click, Ctrl-click"
|
||||||
|
},
|
||||||
|
"pickerContextMenuEntry":{
|
||||||
|
"message":"Elemint blokkearje",
|
||||||
|
"description":"English: Block element"
|
||||||
|
},
|
||||||
|
"settingsCollapseBlockedPrompt":{
|
||||||
|
"message":"Tydlike oantsjutting fan blokkearre eleminten ferstopje",
|
||||||
|
"description":"English: Hide placeholders of blocked elements"
|
||||||
|
},
|
||||||
|
"settingsIconBadgePrompt":{
|
||||||
|
"message":"It tal blokkearre oanfragen op it ikoan toane",
|
||||||
|
"description":"English: Show the number of blocked requests on the icon"
|
||||||
|
},
|
||||||
|
"settingsContextMenuPrompt":{
|
||||||
|
"message":"Wêr mooglik fan it kontekstmenu gebrûk meitsje",
|
||||||
|
"description":"English: Make use of context menu where appropriate"
|
||||||
|
},
|
||||||
|
"settingsAdvancedUserPrompt":{
|
||||||
|
"message":"Ik bin in betûfte brûker (<a href='https:\/\/github.com\/chrisaljoudi\/uBlock\/wiki\/Advanced-user-features'>Lês dit earst<\/a>)",
|
||||||
|
"description":"English: "
|
||||||
|
},
|
||||||
|
"settingsExperimentalPrompt":{
|
||||||
|
"message":"Eksperimentele funksjes ynskeakelje (<a href='https:\/\/github.com\/chrisaljoudi\/uBlock\/wiki\/Experimental-features'>Oer<\/a>)",
|
||||||
|
"description":"English: Enable experimental features"
|
||||||
|
},
|
||||||
|
"settingsStorageUsed":{
|
||||||
|
"message":"Brûkte ûnthâldromte: {{value}} bytes",
|
||||||
|
"description":"English: Storage used: {{}} bytes"
|
||||||
|
},
|
||||||
|
"settingsLastRestorePrompt":{
|
||||||
|
"message":"Lêste werstel:",
|
||||||
|
"description":"English: Last restore:"
|
||||||
|
},
|
||||||
|
"settingsLastBackupPrompt":{
|
||||||
|
"message":"Lêste reservekopy:",
|
||||||
|
"description":"English: Last backup:"
|
||||||
|
},
|
||||||
|
"3pListsOfBlockedHostsPrompt":{
|
||||||
|
"message":"{{netFilterCount}} netwurkfilters + {{cosmeticFilterCount}} kosmetyske filters fan:",
|
||||||
|
"description":"English: {{netFilterCount}} network filters + {{cosmeticFilterCount}} cosmetic filters from:"
|
||||||
|
},
|
||||||
|
"3pListsOfBlockedHostsPerListStats":{
|
||||||
|
"message":"{{used}} gebrûk fan {{total}}",
|
||||||
|
"description":"English: {{used}} used out of {{total}}"
|
||||||
|
},
|
||||||
|
"3pAutoUpdatePrompt1":{
|
||||||
|
"message":"Filterlisten automatysk fernije.",
|
||||||
|
"description":"English: Auto-update filter lists."
|
||||||
|
},
|
||||||
|
"3pUpdateNow":{
|
||||||
|
"message":"No fernije",
|
||||||
|
"description":"English: Update now"
|
||||||
|
},
|
||||||
|
"3pPurgeAll":{
|
||||||
|
"message":"Alle buffers leegje",
|
||||||
|
"description":"English: Purge all caches"
|
||||||
|
},
|
||||||
|
"3pParseAllABPHideFiltersPrompt1":{
|
||||||
|
"message":"Kosmetyske filters ynlêze en tapasse.",
|
||||||
|
"description":"English: Parse and enforce Adblock+ element hiding filters."
|
||||||
|
},
|
||||||
|
"3pParseAllABPHideFiltersInfo":{
|
||||||
|
"message":"<p>Dizze opsje skeakelt it ynlêzen en tapassen fan <a href=\"https:\/\/adblockplus.org\/en\/faq_internal#elemhide\">Adblock Plus-kompatibele “element hiding” filters<\/a> yn. Dizze filters binne suver kosmetysk: se ferstopje eleminten yn de webside dy't fisueel steurend wêze kinne en kinne dus net blokkearre wurde troch de op netfersiken basearre filterengine.<\/p><p>It ynskeakeljen fan dizze funksje ferheget it ûnthâldgebrûk fan <i>uBlock<\/i>.<\/p>",
|
||||||
|
"description":"English: see English messages.json"
|
||||||
|
},
|
||||||
|
"3pListsOfBlockedHostsHeader":{
|
||||||
|
"message":"List fan blokkearree hosts",
|
||||||
|
"description":"English: Lists of blocked hosts"
|
||||||
|
},
|
||||||
|
"3pApplyChanges":{
|
||||||
|
"message":"Wizigingen tapasse",
|
||||||
|
"description":"English: Apply changes"
|
||||||
|
},
|
||||||
|
"3pGroupAds":{
|
||||||
|
"message":"Advertinsjes",
|
||||||
|
"description":"English: Ads"
|
||||||
|
},
|
||||||
|
"3pGroupPrivacy":{
|
||||||
|
"message":"Privacy",
|
||||||
|
"description":"English: Privacy"
|
||||||
|
},
|
||||||
|
"3pGroupMalware":{
|
||||||
|
"message":"Malwaredomeinen",
|
||||||
|
"description":"English: Malware domains"
|
||||||
|
},
|
||||||
|
"3pGroupSocial":{
|
||||||
|
"message":"Sosjaal",
|
||||||
|
"description":"English: Social"
|
||||||
|
},
|
||||||
|
"3pGroupMultipurpose":{
|
||||||
|
"message":"Multifunksjoneel",
|
||||||
|
"description":"English: Multipurpose"
|
||||||
|
},
|
||||||
|
"3pGroupRegions":{
|
||||||
|
"message":"Gebieden, talen",
|
||||||
|
"description":"English: Regions, languages"
|
||||||
|
},
|
||||||
|
"3pGroupCustom":{
|
||||||
|
"message":"Oanpast",
|
||||||
|
"description":"English: Custom"
|
||||||
|
},
|
||||||
|
"3pExternalListsHint":{
|
||||||
|
"message":"Ien URL per rigel. Rigels begjinnend mei ‘!’ wurde negearre. Unjildige URL's wurde stil negearre.",
|
||||||
|
"description":"English: One URL per line. Lines prefixed with ‘!’ will be ignored. Invalid URLs will be silently ignored."
|
||||||
|
},
|
||||||
|
"3pExternalListsApply":{
|
||||||
|
"message":"Tapasse",
|
||||||
|
"description":"English: Parse"
|
||||||
|
},
|
||||||
|
"3pExternalListPurge":{
|
||||||
|
"message":"buffer leegje",
|
||||||
|
"description":"English: purge cache"
|
||||||
|
},
|
||||||
|
"3pExternalListNew":{
|
||||||
|
"message":"nije ferzje beskikber",
|
||||||
|
"description":"English: new version available"
|
||||||
|
},
|
||||||
|
"3pExternalListObsolete":{
|
||||||
|
"message":"ferâldere",
|
||||||
|
"description":"English: outdated"
|
||||||
|
},
|
||||||
|
"3pLastUpdate":{
|
||||||
|
"message":"Lêste fernijing: {{ago}}",
|
||||||
|
"description":"English: Last update: {{ago}}, where 'ago' will be replaced with something like '2 days ago'"
|
||||||
|
},
|
||||||
|
"1pFormatHint":{
|
||||||
|
"message":"Ien filter per rigel. Ien filter kin in gewoane hostnamme of ien Adblock Plus-kompatibel filter wêze. Rigels begjinnend mei ‘!’ wurde negearre.",
|
||||||
|
"description":"English: One filter per line. A filter can be a plain hostname, or an Adblock Plus-compatible filter. Lines prefixed with ‘!’ will be ignored."
|
||||||
|
},
|
||||||
|
"1pImport":{
|
||||||
|
"message":"Ymportearje en tafoegje",
|
||||||
|
"description":"English: Import and append"
|
||||||
|
},
|
||||||
|
"1pExport":{
|
||||||
|
"message":"Eksportearje",
|
||||||
|
"description":"English: Export"
|
||||||
|
},
|
||||||
|
"1pExportFilename":{
|
||||||
|
"message":"myn-ublock-statyske-filters_{{datetime}}.txt",
|
||||||
|
"description":"English: my-ublock-static-filters_{{datetime}}.txt"
|
||||||
|
},
|
||||||
|
"1pApplyChanges":{
|
||||||
|
"message":"Wizigingen tapasse",
|
||||||
|
"description":"English: Apply changes"
|
||||||
|
},
|
||||||
|
"rulesPermanentHeader":{
|
||||||
|
"message":"Permaninte rigels",
|
||||||
|
"description":"header"
|
||||||
|
},
|
||||||
|
"rulesTemporaryHeader":{
|
||||||
|
"message":"Tydlike rigels",
|
||||||
|
"description":"header"
|
||||||
|
},
|
||||||
|
"rulesRevert":{
|
||||||
|
"message":"Tebeksette",
|
||||||
|
"description":"This will remove all temporary rules"
|
||||||
|
},
|
||||||
|
"rulesCommit":{
|
||||||
|
"message":"Tapasse",
|
||||||
|
"description":"This will persist temporary rules"
|
||||||
|
},
|
||||||
|
"rulesEdit":{
|
||||||
|
"message":"Bewurkje",
|
||||||
|
"description":"Will enable manual-edit mode (textarea)"
|
||||||
|
},
|
||||||
|
"rulesEditSave":{
|
||||||
|
"message":"Bewarje",
|
||||||
|
"description":"Will save manually-edited content and exit manual-edit mode"
|
||||||
|
},
|
||||||
|
"rulesEditDiscard":{
|
||||||
|
"message":"Annulearje",
|
||||||
|
"description":"Will discard manually-edited content and exit manual-edit mode"
|
||||||
|
},
|
||||||
|
"rulesImport":{
|
||||||
|
"message":"Ut bestân ymportearje...",
|
||||||
|
"description":""
|
||||||
|
},
|
||||||
|
"rulesExport":{
|
||||||
|
"message":"Nei bestân eksportearje",
|
||||||
|
"description":""
|
||||||
|
},
|
||||||
|
"rulesDefaultFileName":{
|
||||||
|
"message":"myn-ublock-dynamyske-rigels_{{datetime}}.txt",
|
||||||
|
"description":"default file name to use"
|
||||||
|
},
|
||||||
|
"rulesHint":{
|
||||||
|
"message":"List fan jo dynamyske filterrigels.",
|
||||||
|
"description":"English: List of your dynamic filtering rules."
|
||||||
|
},
|
||||||
|
"rulesFormatHint":{
|
||||||
|
"message":"Rigelsyntaks: <code>boarne bestimming type aksje<\/code> (<a href='https:\/\/github.com\/chrisaljoudi\/uBlock\/wiki\/Dynamic-filtering:-rule-syntax'>folsleine dokumintaasje<\/a>).",
|
||||||
|
"description":"English: dynamic rule syntax and full documentation."
|
||||||
|
},
|
||||||
|
"whitelistPrompt":{
|
||||||
|
"message":"Jo list fan hostnammen wêrop uBlock útskeakele is. Ien per rigel ynjaan. Unjildige hostnammen wurde stil negearre.",
|
||||||
|
"description":"English: Your list of host names for which uBlock will be disabled. One host name per line. Invalid host names will be silently ignored."
|
||||||
|
},
|
||||||
|
"whitelistImport":{
|
||||||
|
"message":"Ymportearje en tafoegje",
|
||||||
|
"description":"English: Import and append"
|
||||||
|
},
|
||||||
|
"whitelistExport":{
|
||||||
|
"message":"Eksportearje",
|
||||||
|
"description":"English: Export"
|
||||||
|
},
|
||||||
|
"whitelistExportFilename":{
|
||||||
|
"message":"myn-ublock-whitelist_{{datetime}}.txt",
|
||||||
|
"description":"English: my-ublock-whitelist_{{datetime}}.txt"
|
||||||
|
},
|
||||||
|
"whitelistApply":{
|
||||||
|
"message":"Wizigingen tapasse",
|
||||||
|
"description":"English: Apply changes"
|
||||||
|
},
|
||||||
|
"logNetRequestsPrompt":{
|
||||||
|
"message":"It loggen fan netwurkfersiken ynskeakelje",
|
||||||
|
"description":"English: Enable the logging of network requests"
|
||||||
|
},
|
||||||
|
"logNetRequestsHelp":{
|
||||||
|
"message":"As jo wolle kinne jo de details fan netwurkfersiken besjen troch dizze opsje yn te skeakeljen. It loggen fan netwurkfersiken ferheget it ûnthâldgebrûk fan uBlock. Dizze opsje is standert útskeakele, omdat de measte brûkers dit net brûke.",
|
||||||
|
"description":"English: see _locales\/en\/messages.log"
|
||||||
|
},
|
||||||
|
"logBlockedRequestsHeader":{
|
||||||
|
"message":"Blokkearre fersiken",
|
||||||
|
"description":"English: Blocked requests"
|
||||||
|
},
|
||||||
|
"logAllowedRequestsHeader":{
|
||||||
|
"message":"Talitten fersiken",
|
||||||
|
"description":"English: Allowed requests"
|
||||||
|
},
|
||||||
|
"logRequestsHeaderType":{
|
||||||
|
"message":"Type",
|
||||||
|
"description":"English: Type"
|
||||||
|
},
|
||||||
|
"logRequestsHeaderDomain":{
|
||||||
|
"message":"Domein",
|
||||||
|
"description":"English: Domain"
|
||||||
|
},
|
||||||
|
"logRequestsHeaderURL":{
|
||||||
|
"message":"URL",
|
||||||
|
"description":"English: URL"
|
||||||
|
},
|
||||||
|
"logRequestsHeaderFilter":{
|
||||||
|
"message":"Filter",
|
||||||
|
"description":"English: Filter"
|
||||||
|
},
|
||||||
|
"logBlockedRequestsEmpty":{
|
||||||
|
"message":"Foar dizze side binne gjin blokkearre fersiken logd",
|
||||||
|
"description":"English: No blocked requests logged for this page"
|
||||||
|
},
|
||||||
|
"logAllowedRequestsEmpty":{
|
||||||
|
"message":"Faor dizze side binne gjin talitten fersiken logd",
|
||||||
|
"description":"English: No non-blocked requests logged for this page"
|
||||||
|
},
|
||||||
|
"logBehindTheScene":{
|
||||||
|
"message":"Achter de skermen",
|
||||||
|
"description":"Pretty name for behind-the-scene network requests"
|
||||||
|
},
|
||||||
|
"logFilterPrompt":{
|
||||||
|
"message":"lochboekitems filterje",
|
||||||
|
"description":"English: filter log entries"
|
||||||
|
},
|
||||||
|
"logMaxEntriesTip":{
|
||||||
|
"message":"Maksimum oantal lochboekitems",
|
||||||
|
"description":"Tooltip informaing that the input field is to set the maximum number of entries in the log"
|
||||||
|
},
|
||||||
|
"aboutChangelog":{
|
||||||
|
"message":"Wizigingenlochboek",
|
||||||
|
"description":"English: Change log"
|
||||||
|
},
|
||||||
|
"aboutWiki":{
|
||||||
|
"message":"Wiki",
|
||||||
|
"description":"English: project' wiki on Github"
|
||||||
|
},
|
||||||
|
"aboutCode":{
|
||||||
|
"message":"Boarnekoade (GPLv3)",
|
||||||
|
"description":"English: Source code (GPLv3)"
|
||||||
|
},
|
||||||
|
"aboutContributors":{
|
||||||
|
"message":"Meiwurkers",
|
||||||
|
"description":"English: Contributors"
|
||||||
|
},
|
||||||
|
"aboutBackupDataButton":{
|
||||||
|
"message":"Reservekopy nei bestân",
|
||||||
|
"description":"English: Backup to file"
|
||||||
|
},
|
||||||
|
"aboutBackupFilename":{
|
||||||
|
"message":"myn-ublock-reservekopy_{{datetime}}.txt",
|
||||||
|
"description":"English: my-ublock-backup_{{datetime}}.txt"
|
||||||
|
},
|
||||||
|
"aboutRestoreDataButton":{
|
||||||
|
"message":"Ut bestân werstelle...",
|
||||||
|
"description":"English: Restore from file..."
|
||||||
|
},
|
||||||
|
"aboutResetDataButton":{
|
||||||
|
"message":"Nei de standertynstellingen weromsette...",
|
||||||
|
"description":"English: Reset to default settings..."
|
||||||
|
},
|
||||||
|
"aboutRestoreDataConfirm":{
|
||||||
|
"message":"Al jo ynstellingen sille oerskreaun wurde mei de reservekopygegevens fan {{time}} en uBlock sil werstart wurde.\n\nBinne jo wis dat jo alle besteande ynstellingen oerskriuwe wolle mei de reservekopygegevens?",
|
||||||
|
"description":"Message asking user to confirm restore"
|
||||||
|
},
|
||||||
|
"aboutRestoreDataError":{
|
||||||
|
"message":"De gegevens koenen net lêzen wurde of binne ûnjildich",
|
||||||
|
"description":"Message to display when an error occurred during restore"
|
||||||
|
},
|
||||||
|
"aboutResetDataConfirm":{
|
||||||
|
"message":"Al jo ynstellingen sille fuortsmiten wurde, wêrnei uBlock werstart.\n\nYnstellingen dochs werstelle nei de standertwearden?",
|
||||||
|
"description":"Message asking user to confirm reset"
|
||||||
|
},
|
||||||
|
"errorCantConnectTo":{
|
||||||
|
"message":"Kin net ferbine mei {{url}}",
|
||||||
|
"description":"English: Network error: unable to connect to {{url}}"
|
||||||
|
},
|
||||||
|
"subscriberConfirm":{
|
||||||
|
"message":"uBlock: De folgjende URL oan jo oanpaste filterlisten tafoegje?\n\nTitel: \"{{title}}\"\nURL: {{url}}",
|
||||||
|
"description":"English: The message seen by the user to confirm subscription to a ABP filter list"
|
||||||
|
},
|
||||||
|
"elapsedOneMinuteAgo":{
|
||||||
|
"message":"in minút lyn",
|
||||||
|
"description":"English: a minute ago"
|
||||||
|
},
|
||||||
|
"elapsedManyMinutesAgo":{
|
||||||
|
"message":"{{value}} minuten lyn",
|
||||||
|
"description":"English: {{value}} minutes ago"
|
||||||
|
},
|
||||||
|
"elapsedOneHourAgo":{
|
||||||
|
"message":"in oere lyn",
|
||||||
|
"description":"English: an hour ago"
|
||||||
|
},
|
||||||
|
"elapsedManyHoursAgo":{
|
||||||
|
"message":"{{value}} oeren lyn",
|
||||||
|
"description":"English: {{value}} hours ago"
|
||||||
|
},
|
||||||
|
"elapsedOneDayAgo":{
|
||||||
|
"message":"in dei lyn",
|
||||||
|
"description":"English: a day ago"
|
||||||
|
},
|
||||||
|
"elapsedManyDaysAgo":{
|
||||||
|
"message":"{{value}} dagen lyn",
|
||||||
|
"description":"English: {{value}} days ago"
|
||||||
|
},
|
||||||
|
"showDashboardButton":{
|
||||||
|
"message":"Dashboard toane",
|
||||||
|
"description":"Firefox\/Fennec-specific: Show Dashboard"
|
||||||
|
},
|
||||||
|
"showNetworkLogButton":{
|
||||||
|
"message":"Netwurkfersiken-logboek toane",
|
||||||
|
"description":"Firefox\/Fennec-specific: Show Network Request Log"
|
||||||
|
},
|
||||||
|
"fennecMenuItemBlockingOff":{
|
||||||
|
"message":"útskeakele",
|
||||||
|
"description":"Firefox-specific: appears as 'uBlock (off)'"
|
||||||
|
},
|
||||||
|
"docblockedPrompt1":{
|
||||||
|
"message":"uBlock hat it laden fan de folgjende side opkeard:",
|
||||||
|
"description":"English: uBlock has prevented the following page from loading:"
|
||||||
|
},
|
||||||
|
"docblockedPrompt2":{
|
||||||
|
"message":"Fanwege it folgjende filter",
|
||||||
|
"description":"English: Because of the following filter"
|
||||||
|
},
|
||||||
|
"docblockedBack":{
|
||||||
|
"message":"Tebekgean",
|
||||||
|
"description":"English: Go back"
|
||||||
|
},
|
||||||
|
"docblockedClose":{
|
||||||
|
"message":"Finster slute",
|
||||||
|
"description":"English: Close this window"
|
||||||
|
},
|
||||||
|
"docblockedProceed":{
|
||||||
|
"message":"Strikte blokkearring útskeakelje foar {{hostname}}",
|
||||||
|
"description":"English: Disable strict blocking for {{hostname}} ..."
|
||||||
|
},
|
||||||
|
"docblockedDisableTemporary":{
|
||||||
|
"message":"Tydlik",
|
||||||
|
"description":"English: Temporarily"
|
||||||
|
},
|
||||||
|
"docblockedDisablePermanent":{
|
||||||
|
"message":"Permanint",
|
||||||
|
"description":"English: Permanently"
|
||||||
|
},
|
||||||
|
"dummy":{
|
||||||
|
"message":"This entry must be the last one",
|
||||||
|
"description":"so we dont need to deal with comma for last entry"
|
||||||
|
}
|
||||||
|
}
|
|
@ -88,7 +88,7 @@ return {
|
||||||
|
|
||||||
// read-only
|
// read-only
|
||||||
systemSettings: {
|
systemSettings: {
|
||||||
compiledMagic: 'akjbdyreyxgm',
|
compiledMagic: 'eopszukpnrct',
|
||||||
selfieMagic: 'spqmeuaftfra'
|
selfieMagic: 'spqmeuaftfra'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -873,13 +873,21 @@ FilterHostnameDict.prototype.meltBucket = function(len, bucket) {
|
||||||
} else {
|
} else {
|
||||||
var offset = 0;
|
var offset = 0;
|
||||||
while ( offset < bucket.length ) {
|
while ( offset < bucket.length ) {
|
||||||
map[bucket.substring(offset, len)] = true;
|
map[bucket.substr(offset, len)] = true;
|
||||||
offset += len;
|
offset += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FilterHostnameDict.prototype.freezeBucket = function(bucket) {
|
||||||
|
var hostnames = Object.keys(bucket);
|
||||||
|
if ( hostnames[0].length * hostnames.length < this.cutoff ) {
|
||||||
|
return ' ' + hostnames.join(' ') + ' ';
|
||||||
|
}
|
||||||
|
return hostnames.sort().join('');
|
||||||
|
};
|
||||||
|
|
||||||
// How the key is derived dictates the number and size of buckets:
|
// How the key is derived dictates the number and size of buckets:
|
||||||
// - more bits = more buckets = higher memory footprint
|
// - more bits = more buckets = higher memory footprint
|
||||||
// - less bits = less buckets = lower memory footprint
|
// - less bits = less buckets = lower memory footprint
|
||||||
|
@ -927,7 +935,7 @@ FilterHostnameDict.prototype.add = function(hn) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ( typeof bucket === 'string' ) {
|
if ( typeof bucket === 'string' ) {
|
||||||
bucket = this.dict[key] = this.meltBucket(hn.len, bucket);
|
bucket = this.dict[key] = this.meltBucket(hn.length, bucket);
|
||||||
}
|
}
|
||||||
if ( bucket.hasOwnProperty(hn) ) {
|
if ( bucket.hasOwnProperty(hn) ) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -939,19 +947,13 @@ FilterHostnameDict.prototype.add = function(hn) {
|
||||||
|
|
||||||
FilterHostnameDict.prototype.freeze = function() {
|
FilterHostnameDict.prototype.freeze = function() {
|
||||||
var buckets = this.dict;
|
var buckets = this.dict;
|
||||||
var bucket, hostnames, len;
|
var bucket;
|
||||||
for ( var key in buckets ) {
|
for ( var key in buckets ) {
|
||||||
bucket = buckets[key];
|
bucket = buckets[key];
|
||||||
if ( typeof bucket !== 'object' ) {
|
if ( typeof bucket !== 'object' ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
hostnames = Object.keys(bucket);
|
buckets[key] = this.freezeBucket(bucket);
|
||||||
len = hostnames[0].length * hostnames.length;
|
|
||||||
if ( hostnames[0].length * hostnames.length < this.cutoff ) {
|
|
||||||
buckets[key] = ' ' + hostnames.join(' ') + ' ';
|
|
||||||
} else {
|
|
||||||
buckets[key] = hostnames.sort().join('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -964,7 +966,7 @@ FilterHostnameDict.prototype.matchesExactly = function(hn) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ( typeof bucket === 'object' ) {
|
if ( typeof bucket === 'object' ) {
|
||||||
return bucket.hasOwnProperty(hn);
|
bucket = this.dict[key] = this.freezeBucket(bucket);
|
||||||
}
|
}
|
||||||
if ( bucket.charAt(0) === ' ' ) {
|
if ( bucket.charAt(0) === ' ' ) {
|
||||||
return bucket.indexOf(' ' + hn + ' ') !== -1;
|
return bucket.indexOf(' ' + hn + ' ') !== -1;
|
||||||
|
@ -1624,26 +1626,26 @@ FilterContainer.prototype.freeze = function() {
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
FilterContainer.prototype.factories = {
|
FilterContainer.prototype.factories = {
|
||||||
'[]': FilterBucket,
|
'[]': FilterBucket,
|
||||||
'a': FilterPlain,
|
'a': FilterPlain,
|
||||||
'ah': FilterPlainHostname,
|
'ah': FilterPlainHostname,
|
||||||
'0a': FilterPlainPrefix0,
|
'0a': FilterPlainPrefix0,
|
||||||
'0ah': FilterPlainPrefix0Hostname,
|
'0ah': FilterPlainPrefix0Hostname,
|
||||||
'1a': FilterPlainPrefix1,
|
'1a': FilterPlainPrefix1,
|
||||||
'1ah': FilterPlainPrefix1Hostname,
|
'1ah': FilterPlainPrefix1Hostname,
|
||||||
'|a': FilterPlainLeftAnchored,
|
'|a': FilterPlainLeftAnchored,
|
||||||
'|ah': FilterPlainLeftAnchoredHostname,
|
'|ah': FilterPlainLeftAnchoredHostname,
|
||||||
'a|': FilterPlainRightAnchored,
|
'a|': FilterPlainRightAnchored,
|
||||||
'a|h': FilterPlainRightAnchoredHostname,
|
'a|h': FilterPlainRightAnchoredHostname,
|
||||||
'||a': FilterPlainHnAnchored,
|
'||a': FilterPlainHnAnchored,
|
||||||
'||ah': FilterPlainHnAnchoredHostname,
|
'||ah': FilterPlainHnAnchoredHostname,
|
||||||
'//': FilterRegex,
|
'//': FilterRegex,
|
||||||
'//h': FilterRegexHostname,
|
'//h': FilterRegexHostname,
|
||||||
'{h}': FilterHostnameDict,
|
'{h}': FilterHostnameDict,
|
||||||
'_': FilterGeneric,
|
'_': FilterGeneric,
|
||||||
'_h': FilterGenericHostname,
|
'_h': FilterGenericHostname,
|
||||||
'||_': FilterGenericHnAnchored,
|
'||_': FilterGenericHnAnchored,
|
||||||
'||_h': FilterGenericHnAnchoredHostname
|
'||_h': FilterGenericHnAnchoredHostname
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
|
@ -152,22 +152,26 @@
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
µBlock.appendUserFilters = function(filter) {
|
µBlock.appendUserFilters = function(filters) {
|
||||||
if ( filter.length === 0 ) {
|
if ( filters.length === 0 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var µb = this;
|
var µb = this;
|
||||||
|
|
||||||
var onCompiledListLoaded = function(details) {
|
var onCompiledListLoaded = function() {
|
||||||
|
var compiledFilters = µb.compileFilters(filters);
|
||||||
var snfe = µb.staticNetFilteringEngine;
|
var snfe = µb.staticNetFilteringEngine;
|
||||||
var cfe = µb.cosmeticFilteringEngine;
|
var cfe = µb.cosmeticFilteringEngine;
|
||||||
var acceptedCount = snfe.acceptedCount + cfe.acceptedCount;
|
var acceptedCount = snfe.acceptedCount + cfe.acceptedCount;
|
||||||
var duplicateCount = snfe.duplicateCount + cfe.duplicateCount;
|
var duplicateCount = snfe.duplicateCount + cfe.duplicateCount;
|
||||||
µb.applyCompiledFilters(details.content);
|
µb.applyCompiledFilters(compiledFilters);
|
||||||
var entry = µb.remoteBlacklists[µb.userFiltersPath];
|
var entry = µb.remoteBlacklists[µb.userFiltersPath];
|
||||||
entry.entryCount = snfe.acceptedCount + cfe.acceptedCount - acceptedCount;
|
var deltaEntryCount = snfe.acceptedCount + cfe.acceptedCount - acceptedCount;
|
||||||
entry.entryUsedCount = entry.entryCount - snfe.duplicateCount - cfe.duplicateCount + duplicateCount;
|
var deltaEntryUsedCount = deltaEntryCount - (snfe.duplicateCount + cfe.duplicateCount - duplicateCount);
|
||||||
|
entry.entryCount += deltaEntryCount;
|
||||||
|
entry.entryUsedCount += deltaEntryUsedCount;
|
||||||
|
vAPI.storage.set({ 'remoteBlacklists': µb.remoteBlacklists });
|
||||||
µb.staticNetFilteringEngine.freeze();
|
µb.staticNetFilteringEngine.freeze();
|
||||||
µb.cosmeticFilteringEngine.freeze();
|
µb.cosmeticFilteringEngine.freeze();
|
||||||
};
|
};
|
||||||
|
@ -187,7 +191,7 @@
|
||||||
// If we reached this point, the filter quite probably needs to be
|
// If we reached this point, the filter quite probably needs to be
|
||||||
// added for sure: do not try to be too smart, trying to avoid
|
// added for sure: do not try to be too smart, trying to avoid
|
||||||
// duplicates at this point may lead to more issues.
|
// duplicates at this point may lead to more issues.
|
||||||
µb.saveUserFilters(details.content.trim() + '\n\n' + filter.trim(), onSaved);
|
µb.saveUserFilters(details.content.trim() + '\n\n' + filters.trim(), onSaved);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.loadUserFilters(onLoaded);
|
this.loadUserFilters(onLoaded);
|
||||||
|
|
|
@ -209,6 +209,10 @@ housekeep itself.
|
||||||
if ( vAPI.isBehindTheSceneTabId(this.tabId) ) {
|
if ( vAPI.isBehindTheSceneTabId(this.tabId) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var count = this.stack.length;
|
||||||
|
if ( count !== 0 && this.stack[count - 1] === url ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.stack.push(url);
|
this.stack.push(url);
|
||||||
this.update();
|
this.update();
|
||||||
};
|
};
|
||||||
|
|
|
@ -287,6 +287,9 @@ var onHeadersReceived = function(details) {
|
||||||
|
|
||||||
return { 'responseHeaders': details.responseHeaders };
|
return { 'responseHeaders': details.responseHeaders };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
var onRootFrameHeadersReceived = function(details) {
|
var onRootFrameHeadersReceived = function(details) {
|
||||||
var tabId = details.tabId;
|
var tabId = details.tabId;
|
||||||
var requestURL = details.url;
|
var requestURL = details.url;
|
||||||
|
@ -297,6 +300,8 @@ var onRootFrameHeadersReceived = function(details) {
|
||||||
// ...
|
// ...
|
||||||
if ( headerValue(details.responseHeaders, 'content-disposition').lastIndexOf('attachment', 0) === 0 ) {
|
if ( headerValue(details.responseHeaders, 'content-disposition').lastIndexOf('attachment', 0) === 0 ) {
|
||||||
µb.tabContextManager.unpush(tabId, requestURL);
|
µb.tabContextManager.unpush(tabId, requestURL);
|
||||||
|
} else {
|
||||||
|
µb.tabContextManager.push(tabId, requestURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lookup the page store associated with this tab id.
|
// Lookup the page store associated with this tab id.
|
||||||
|
@ -304,7 +309,6 @@ var onRootFrameHeadersReceived = function(details) {
|
||||||
if ( !pageStore ) {
|
if ( !pageStore ) {
|
||||||
pageStore = µb.bindTabToPageStats(tabId, 'beforeRequest');
|
pageStore = µb.bindTabToPageStats(tabId, 'beforeRequest');
|
||||||
}
|
}
|
||||||
// I can't think of how pageStore could be null at this point.
|
|
||||||
|
|
||||||
var context = pageStore.createContextFromPage();
|
var context = pageStore.createContextFromPage();
|
||||||
context.requestURL = requestURL + '{inline-script}';
|
context.requestURL = requestURL + '{inline-script}';
|
||||||
|
|
|
@ -72,10 +72,10 @@ var reIPAddressNaive = /^\d+\.\d+\.\d+\.\d+$|^\[[\da-zA-Z:]+\]$/;
|
||||||
|
|
||||||
// Accurate tests
|
// Accurate tests
|
||||||
// Source.: http://stackoverflow.com/questions/5284147/validating-ipv4-addresses-with-regexp/5284410#5284410
|
// Source.: http://stackoverflow.com/questions/5284147/validating-ipv4-addresses-with-regexp/5284410#5284410
|
||||||
var reIPv4 = /^((25[0-5]|2[0-4]\d|[01]?\d\d?)(\.|$)){4}/;
|
//var reIPv4 = /^((25[0-5]|2[0-4]\d|[01]?\d\d?)(\.|$)){4}/;
|
||||||
|
|
||||||
// Source: http://forums.intermapper.com/viewtopic.php?p=1096#1096
|
// Source: http://forums.intermapper.com/viewtopic.php?p=1096#1096
|
||||||
var reIPv6 = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
|
//var reIPv6 = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
@ -366,11 +366,18 @@ var domainCachePrune = function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var domainCacheReset = function() {
|
||||||
|
domainCache = {};
|
||||||
|
domainCacheCount = 0;
|
||||||
|
};
|
||||||
|
|
||||||
var domainCache = {};
|
var domainCache = {};
|
||||||
var domainCacheCount = 0;
|
var domainCacheCount = 0;
|
||||||
var domainCacheCountLowWaterMark = 75;
|
var domainCacheCountLowWaterMark = 75;
|
||||||
var domainCacheCountHighWaterMark = 100;
|
var domainCacheCountHighWaterMark = 100;
|
||||||
|
|
||||||
|
psl.onChanged.addListener(domainCacheReset);
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
URI.domainFromURI = function(uri) {
|
URI.domainFromURI = function(uri) {
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
|
|
||||||
;(function(root) {
|
;(function(root) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
var exceptions = {};
|
var exceptions = {};
|
||||||
|
@ -45,6 +47,8 @@ var selfieMagic = 'iscjsfsaolnm';
|
||||||
var cutoffLength = 256;
|
var cutoffLength = 256;
|
||||||
var mustPunycode = /[^a-z0-9.-]/;
|
var mustPunycode = /[^a-z0-9.-]/;
|
||||||
|
|
||||||
|
var onChangedListeners = [];
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
// In the context of this code, a domain is defined as:
|
// In the context of this code, a domain is defined as:
|
||||||
|
@ -234,6 +238,7 @@ function parse(text, toAscii) {
|
||||||
}
|
}
|
||||||
crystallize(exceptions);
|
crystallize(exceptions);
|
||||||
crystallize(rules);
|
crystallize(rules);
|
||||||
|
callListeners(onChangedListeners);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -302,11 +307,47 @@ function fromSelfie(selfie) {
|
||||||
}
|
}
|
||||||
rules = selfie.rules;
|
rules = selfie.rules;
|
||||||
exceptions = selfie.exceptions;
|
exceptions = selfie.exceptions;
|
||||||
|
callListeners(onChangedListeners);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
var addListener = function(listeners, callback) {
|
||||||
|
if ( typeof callback !== 'function' ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( listeners.indexOf(callback) === -1 ) {
|
||||||
|
listeners.push(callback);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var removeListener = function(listeners, callback) {
|
||||||
|
var pos = listeners.indexOf(callback);
|
||||||
|
if ( pos !== -1 ) {
|
||||||
|
listeners.splice(pos, 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var callListeners = function(listeners) {
|
||||||
|
for ( var i = 0; i < listeners.length; i++ ) {
|
||||||
|
listeners[i]();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
var onChanged = {
|
||||||
|
addListener: function(callback) {
|
||||||
|
addListener(onChangedListeners, callback);
|
||||||
|
},
|
||||||
|
removeListener: function(callback) {
|
||||||
|
removeListener(onChangedListeners, callback);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
// Public API
|
// Public API
|
||||||
|
|
||||||
root = root || window;
|
root = root || window;
|
||||||
|
@ -317,7 +358,8 @@ root.publicSuffixList = {
|
||||||
'getDomain': getDomain,
|
'getDomain': getDomain,
|
||||||
'getPublicSuffix': getPublicSuffix,
|
'getPublicSuffix': getPublicSuffix,
|
||||||
'toSelfie': toSelfie,
|
'toSelfie': toSelfie,
|
||||||
'fromSelfie': fromSelfie
|
'fromSelfie': fromSelfie,
|
||||||
|
'onChanged': onChanged
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue