/******************************************************************************* uMatrix - a browser extension to black/white list requests. Copyright (C) 2014-present Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. Home: https://github.com/gorhill/uMatrix */ 'use strict'; /******************************************************************************/ const µMatrix = (( ) => { // jshint ignore:line /******************************************************************************/ const oneSecond = 1000; const oneMinute = 60 * oneSecond; const oneHour = 60 * oneMinute; const oneDay = 24 * oneHour; /******************************************************************************* SVG-based icons below were extracted from fontawesome-webfont.svg v4.7. Excerpt of copyright notice at the top of the file: > Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 > By ,,, > Copyright Dave Gandy 2016. All rights reserved. Excerpt of the license information in the fontawesome CSS file bundled with the package: > Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome > License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) Font icons: - glyph-name: "external_link" */ const rawSettingsDefault = { assetFetchBypassBrowserCache: false, assetFetchTimeout: 30, autoUpdateAssetFetchPeriod: 120, cnameIgnoreList: 'unset', cnameIgnore1stParty: true, cnameIgnoreExceptions: true, cnameIgnoreRootDocument: true, cnameMaxTTL: 60, cnameReplayFullURL: false, consoleLogLevel: 'unset', contributorMode: false, disableCSPReportInjection: false, disableWebAssembly: false, enforceEscapedFragment: true, loggerPopupType: 'popup', manualUpdateAssetFetchPeriod: 500, placeholderBackground: [ 'url("data:image/png;base64,', 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAK', 'CAAAAACoWZBhAAAABGdBTUEAALGPC/xh', 'BQAAAAJiS0dEAP+Hj8y/AAAAB3RJTUUH', '3wwIAAgyL/YaPAAAACJJREFUCFtjfMbO', 'AAQ/gZiFnQPEBAEmGIMIJgtIL8QEgtoA', 'In4D/96X1KAAAAAldEVYdGRhdGU6Y3Jl', 'YXRlADIwMTUtMTItMDhUMDA6MDg6NTAr', 'MDM6MDAasuuJAAAAJXRFWHRkYXRlOm1v', 'ZGlmeQAyMDE1LTEyLTA4VDAwOjA4OjUw', 'KzAzOjAwa+9TNQAAAABJRU5ErkJggg==', '") ', 'repeat scroll #fff' ].join(''), placeholderBorder: '1px solid rgba(0, 0, 0, 0.1)', imagePlaceholder: true, imagePlaceholderBackground: 'default', imagePlaceholderBorder: 'default', framePlaceholder: true, framePlaceholderDocument: [ '', '', '', '', '', '{{url}}', '' ].join(''), framePlaceholderBackground: 'default', suspendTabsUntilReady: false }; /******************************************************************************/ return { onBeforeStartQueue: [], userSettings: { alwaysDetachLogger: false, autoUpdate: true, clearBrowserCache: true, clearBrowserCacheAfter: 60, cloudStorageEnabled: false, collapseBlacklisted: true, collapseBlocked: false, colorBlindFriendly: false, deleteCookies: false, deleteUnusedSessionCookies: false, deleteUnusedSessionCookiesAfter: 60, deleteLocalStorage: false, displayTextSize: '14px', externalHostsFiles: [], externalRecipeFiles: [], iconBadgeEnabled: true, noTooltips: false, popupCollapseAllDomains: false, popupCollapseBlacklistedDomains: false, popupScopeLevel: 'domain', processHyperlinkAuditing: true, selectedHostsFiles: [ '' ], selectedRecipeFiles: [ '' ], userHosts: { enabled: false, content: '' }, userRecipes: { enabled: false, content: '' } }, rawSettingsDefault: rawSettingsDefault, rawSettings: (( ) => { const out = Object.assign({}, rawSettingsDefault); const json = vAPI.localStorage.getItem('immediateRawSettings'); if ( typeof json !== 'string' ) { return out; } try { const o = JSON.parse(json); if ( o instanceof Object ) { for ( const k in o ) { if ( out.hasOwnProperty(k) ) { out[k] = o[k]; } } self.log.verbosity = out.consoleLogLevel; if ( typeof out.suspendTabsUntilReady === 'boolean' ) { out.suspendTabsUntilReady = out.suspendTabsUntilReady ? 'yes' : 'unset'; } } } catch(ex) { } return out; })(), rawSettingsWriteTime: 0, clearBrowserCacheCycle: 0, cspNoInlineScript: "script-src 'unsafe-eval' blob: *", cspNoInlineStyle: "style-src blob: *", cspNoWorker: "worker-src 'none'; report-uri about:blank", cantMergeCSPHeaders: false, updateAssetsEvery: 11 * oneDay + 1 * oneHour + 1 * oneMinute + 1 * oneSecond, firstUpdateAfter: 11 * oneMinute, nextUpdateAfter: 11 * oneHour, assetsBootstrapLocation: 'assets/assets.json', pslAssetKey: 'public_suffix_list.dat', // list of live hosts files liveHostsFiles: new Map(), // urls stats are kept on the back burner while waiting to be reactivated // in a tab or another. pageStores: new Map(), pageStoresToken: 0, pageStoreCemetery: new Map(), // page url => permission scope tMatrix: null, pMatrix: null, ubiquitousBlacklist: null, ubiquitousBlacklistRef: null, // various stats cookieRemovedCounter: 0, localStorageRemovedCounter: 0, cookieHeaderFoiledCounter: 0, hyperlinkAuditingFoiledCounter: 0, browserCacheClearedCounter: 0, // record what the browser is doing behind the scene behindTheSceneScope: 'behind-the-scene', noopFunc: function(){}, // so that I don't have to care for last comma dummy: 0 }; /******************************************************************************/ })(); /******************************************************************************/