mirror of https://github.com/gorhill/uBlock.git
fix #1641
This commit is contained in:
parent
b68c4f8f85
commit
da163bbe4b
|
@ -127,9 +127,8 @@ var exportUserFiltersToFile = function() {
|
||||||
if ( val === '' ) {
|
if ( val === '' ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var now = new Date();
|
|
||||||
var filename = vAPI.i18n('1pExportFilename')
|
var filename = vAPI.i18n('1pExportFilename')
|
||||||
.replace('{{datetime}}', now.toLocaleString())
|
.replace('{{datetime}}', uBlockDashboard.dateNowToSensibleString())
|
||||||
.replace(/ +/g, '_');
|
.replace(/ +/g, '_');
|
||||||
vAPI.download({
|
vAPI.download({
|
||||||
'url': 'data:text/plain;charset=utf-8,' + encodeURIComponent(val + '\n'),
|
'url': 'data:text/plain;charset=utf-8,' + encodeURIComponent(val + '\n'),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
µBlock - a browser extension to block requests.
|
uBlock Origin - a browser extension to block requests.
|
||||||
Copyright (C) 2014 Raymond Hill
|
Copyright (C) 2014-2016 Raymond Hill
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -103,6 +103,15 @@ self.uBlockDashboard.mergeNewLines = function(text, newText) {
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
self.uBlockDashboard.dateNowToSensibleString = function() {
|
||||||
|
var now = new Date(Date.now() - (new Date()).getTimezoneOffset() * 60000);
|
||||||
|
return now.toISOString().replace(/\.\d+Z$/, '')
|
||||||
|
.replace(/:/g, '.')
|
||||||
|
.replace('T', '_');
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
// Open links in the proper window
|
// Open links in the proper window
|
||||||
uDom('a').attr('target', '_blank');
|
uDom('a').attr('target', '_blank');
|
||||||
uDom('a[href*="dashboard.html"]').attr('target', '_parent');
|
uDom('a[href*="dashboard.html"]').attr('target', '_parent');
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
Home: https://github.com/gorhill/uMatrix
|
Home: https://github.com/gorhill/uMatrix
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global uDom */
|
/* global uDom, uBlockDashboard */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
@ -153,9 +153,8 @@ var startImportFilePicker = function() {
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
function exportUserRulesToFile() {
|
function exportUserRulesToFile() {
|
||||||
var now = new Date();
|
|
||||||
var filename = vAPI.i18n('rulesDefaultFileName')
|
var filename = vAPI.i18n('rulesDefaultFileName')
|
||||||
.replace('{{datetime}}', now.toLocaleString())
|
.replace('{{datetime}}', uBlockDashboard.dateNowToSensibleString())
|
||||||
.replace(/ +/g, '_');
|
.replace(/ +/g, '_');
|
||||||
vAPI.download({
|
vAPI.download({
|
||||||
'url': 'data:text/plain,' + encodeURIComponent(rulesFromHTML('#diff .left li') + '\n'),
|
'url': 'data:text/plain,' + encodeURIComponent(rulesFromHTML('#diff .left li') + '\n'),
|
||||||
|
|
|
@ -745,9 +745,8 @@ var backupUserData = function(callback) {
|
||||||
var onSelectedListsReady = function(filterLists) {
|
var onSelectedListsReady = function(filterLists) {
|
||||||
userData.filterLists = filterLists;
|
userData.filterLists = filterLists;
|
||||||
|
|
||||||
var now = new Date();
|
|
||||||
var filename = vAPI.i18n('aboutBackupFilename')
|
var filename = vAPI.i18n('aboutBackupFilename')
|
||||||
.replace('{{datetime}}', now.toLocaleString())
|
.replace('{{datetime}}', µb.dateNowToSensibleString())
|
||||||
.replace(/ +/g, '_');
|
.replace(/ +/g, '_');
|
||||||
|
|
||||||
vAPI.download({
|
vAPI.download({
|
||||||
|
|
|
@ -135,6 +135,15 @@
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
µBlock.dateNowToSensibleString = function() {
|
||||||
|
var now = new Date(Date.now() - (new Date()).getTimezoneOffset() * 60000);
|
||||||
|
return now.toISOString().replace(/\.\d+Z$/, '')
|
||||||
|
.replace(/:/g, '.')
|
||||||
|
.replace('T', '_');
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
µBlock.LineIterator = function(text, offset) {
|
µBlock.LineIterator = function(text, offset) {
|
||||||
this.text = text;
|
this.text = text;
|
||||||
this.textLen = this.text.length;
|
this.textLen = this.text.length;
|
||||||
|
|
|
@ -96,9 +96,8 @@ var exportWhitelistToFile = function() {
|
||||||
if ( val === '' ) {
|
if ( val === '' ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var now = new Date();
|
|
||||||
var filename = vAPI.i18n('whitelistExportFilename')
|
var filename = vAPI.i18n('whitelistExportFilename')
|
||||||
.replace('{{datetime}}', now.toLocaleString())
|
.replace('{{datetime}}', uBlockDashboard.dateNowToSensibleString())
|
||||||
.replace(/ +/g, '_');
|
.replace(/ +/g, '_');
|
||||||
vAPI.download({
|
vAPI.download({
|
||||||
'url': 'data:text/plain;charset=utf-8,' + encodeURIComponent(val + '\n'),
|
'url': 'data:text/plain;charset=utf-8,' + encodeURIComponent(val + '\n'),
|
||||||
|
|
Loading…
Reference in New Issue