Browse Source

preparing for i18n + better defaults

pull/2/head
gorhill 10 years ago
parent
commit
05089dc370
  1. 20
      src/_locales/en/messages.json
  2. 4
      src/js/background.js
  3. 2
      src/js/browsercache.js
  4. 8
      src/js/cookies.js
  5. 2
      src/js/storage.js
  6. 6
      src/js/useragent.js

20
src/_locales/en/messages.json

@ -587,6 +587,26 @@
"message": "filter expression(s)", "message": "filter expression(s)",
"description": "Appears in the input filed where filter expressions are entered" "description": "Appears in the input filed where filter expressions are entered"
}, },
"loggerEntryUserAgentSpoofing" : {
"message": "spoofing user agent with: {{value}}",
"description": "An entry for when a new user agent string is selected"
},
"loggerEntryCookieDeleted" : {
"message": "cookie deleted: {{value}}",
"description": "An entry for when a cookie is deleted"
},
"loggerEntryDeleteCookieError" : {
"message": "browser cache cleared",
"description": "An entry for when the browser cache is cleared"
},
"loggerEntryBrowserCacheCleared" : {
"message": "failed to delete cookie: {{value}}",
"description": "An entry for when a cookie can't be deleted"
},
"loggerEntryAssetUpdated" : {
"message": "asset updated: {{value}}",
"description": "An entry for when an asset was updated"
},
"mainBlockedPrompt1": { "mainBlockedPrompt1": {
"message": "uMatrix has prevented the following page from loading:", "message": "uMatrix has prevented the following page from loading:",

4
src/js/background.js

@ -61,8 +61,8 @@ return {
deleteLocalStorage: false, deleteLocalStorage: false,
displayTextSize: '13px', displayTextSize: '13px',
externalHostsFiles: '', externalHostsFiles: '',
iconBadgeEnabled: true,
maxLoggedRequests: 2000,
iconBadgeEnabled: false,
maxLoggedRequests: 1000,
popupCollapseDomains: false, popupCollapseDomains: false,
popupCollapseSpecificDomains: {}, popupCollapseSpecificDomains: {},
popupHideBlacklisted: false, popupHideBlacklisted: false,

2
src/js/browsercache.js

@ -50,7 +50,7 @@ var clearCache = function() {
µm.browserCacheClearedCounter++; µm.browserCacheClearedCounter++;
// TODO: i18n // TODO: i18n
µm.logger.writeOne('', 'info', 'browser cache cleared');
µm.logger.writeOne('', 'info', vAPI.i18n('loggerEntryBrowserCacheCleared'));
//console.debug('clearBrowserCacheCallback()> vAPI.browserData.clearCache() called'); //console.debug('clearBrowserCacheCallback()> vAPI.browserData.clearCache() called');
}; };

8
src/js/cookies.js

@ -296,18 +296,18 @@ var chromeCookieRemove = function(url, name) {
var success = !!details; var success = !!details;
if ( removeCookieFromDict(sessionCookieKey) ) { if ( removeCookieFromDict(sessionCookieKey) ) {
if ( success ) { if ( success ) {
µm.logger.writeOne('', 'info', 'cookie deleted: ' + sessionCookieKey);
µm.logger.writeOne('', 'info', vAPI.i18n('loggerEntryCookieDeleted').replace('{{value}}', sessionCookieKey));
µm.cookieRemovedCounter += 1; µm.cookieRemovedCounter += 1;
} else { } else {
µm.logger.writeOne('', 'error', 'failed to delete cookie: ' + sessionCookieKey);
µm.logger.writeOne('', 'error', vAPI.i18n('loggerEntryDeleteCookieError').replace('{{value}}', sessionCookieKey));
} }
} }
if ( removeCookieFromDict(persistCookieKey) ) { if ( removeCookieFromDict(persistCookieKey) ) {
if ( success ) { if ( success ) {
µm.logger.writeOne('', 'info', 'cookie deleted: ' + persistCookieKey);
µm.logger.writeOne('', 'info', vAPI.i18n('loggerEntryCookieDeleted').replace('{{value}}', persistCookieKey));
µm.cookieRemovedCounter += 1; µm.cookieRemovedCounter += 1;
} else { } else {
µm.logger.writeOne('', 'error', 'failed to delete cookie: ' + persistCookieKey);
µm.logger.writeOne('', 'error', vAPI.i18n('loggerEntryDeleteCookieError').replace('{{value}}', persistCookieKey));
} }
} }
}; };

2
src/js/storage.js

@ -408,7 +408,7 @@
var path = details.path || ''; var path = details.path || '';
if ( path !== '' ) { if ( path !== '' ) {
this.logger.writeOne('', 'info', 'asset updated: ' + path);
this.logger.writeOne('', 'info', vAPI.i18n('loggerEntryAssetUpdated').replace('{{value}}', path));
} }
if ( this.liveHostsFiles.hasOwnProperty(path) === false ) { if ( this.liveHostsFiles.hasOwnProperty(path) === false ) {

6
src/js/useragent.js

@ -60,7 +60,11 @@ var userAgentSpoofer = function(force) {
if ( uaStr === '' ) { if ( uaStr === '' ) {
µm.userAgentReplaceStr = userAgentRandomPicker(); µm.userAgentReplaceStr = userAgentRandomPicker();
µm.userAgentReplaceStrBirth = Date.now(); µm.userAgentReplaceStrBirth = Date.now();
µm.logger.writeOne('', 'info', 'spoofing user agent with: ' + µm.userAgentReplaceStr);
µm.logger.writeOne(
'',
'info',
vAPI.i18n('loggerEntryUserAgentSpoofing').replace('{{value}}', µm.userAgentReplaceStr)
);
} }
}; };

Loading…
Cancel
Save