Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

Commit 70e849e

Browse files
committed
Merge branch 'dev'
2 parents 5a990f2 + 45fe704 commit 70e849e

36 files changed

Lines changed: 9506 additions & 9094 deletions

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,29 @@
33
"version": "2.6.2",
44
"description": "Violentmonkey for Maxthon",
55
"scripts": {
6-
"clean": "gulp clean",
6+
"prebuild": "gulp clean",
77
"build": "gulp build",
88
"dev": "gulp watch",
99
"i18n": "gulp i18n",
1010
"lint": "gulp lint",
1111
"update": "node scripts/update"
1212
},
1313
"devDependencies": {
14-
"codemirror": "^5.14.2",
15-
"define-commonjs": "^1.0.1",
1614
"del": "^2.2.0",
1715
"gulp": "^3.9.1",
1816
"gulp-concat": "^2.6.0",
1917
"gulp-cssnano": "^2.1.2",
20-
"gulp-eslint": "^2.0.0",
18+
"gulp-eslint": "^3.0.1",
2119
"gulp-filter": "^4.0.0",
2220
"gulp-footer": "^1.0.5",
2321
"gulp-svg-sprite": "^1.2.19",
24-
"gulp-uglify": "^1.5.3",
22+
"gulp-uglify": "^2.0.0",
2523
"gulp-util": "^3.0.4",
26-
"html-minifier": "^2.1.0",
24+
"html-minifier": "^3.2.3",
2725
"merge2": "^1.0.2",
2826
"ncp": "^2.0.0",
2927
"sync-promise-lite": "^0.2.3",
30-
"through2": "^2.0.1",
31-
"underscore": "^1.8.3"
28+
"through2": "^2.0.3"
3229
},
3330
"author": "Gerald <i@gerald.top>",
3431
"repository": {
@@ -39,5 +36,10 @@
3936
"url": "https://github.com/violentmonkey/violentmonkey-mx/issues"
4037
},
4138
"homepage": "https://github.com/violentmonkey/violentmonkey-mx",
42-
"license": "MIT"
39+
"license": "MIT",
40+
"dependencies": {
41+
"codemirror": "^5.23.0",
42+
"define-commonjs": "^1.0.1",
43+
"vue": "^2.1.10"
44+
}
4345
}

scripts/update.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const mappings = {
3333
CodeMirror: 'codemirror',
3434
'define.js': 'define-commonjs',
3535
'promise.js': 'sync-promise-lite',
36+
'vue.min.js': 'vue/dist',
3637
};
3738

3839
function updateFile(dest, src) {

src/background/app.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,12 @@ vmdb.initialized.then(function () {
314314
_.setIcon('icon' + (_.options.get('isApplied') ? '' : 'w'));
315315

316316
tabsUtils.on('TAB_SWITCH', badges.get);
317+
tabsUtils.on('ON_NAVIGATE', function (tab) {
318+
// file:/// URLs will not be injected on Maxthon 5
319+
if (/^file:\/\/\/.*?\.user\.js$/.test(tab.url)) {
320+
commands.InstallScript({
321+
url: tab.url,
322+
});
323+
_.tabs.remove(tab.id);
324+
}
325+
});

src/common.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ polyfill(Object, 'assign', function () {
1818
polyfill(String.prototype, 'startsWith', function (str) {
1919
return this.slice(0, str.length) === str;
2020
});
21+
polyfill(String.prototype, 'endsWith', function (str) {
22+
return this.slice(-str.length) === str;
23+
});
2124
polyfill(Array.prototype, 'findIndex', function (predicate) {
2225
var length = this.length;
2326
for (var i = 0; i < length; i ++) {

src/injected.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ function checkJS() {
784784
});
785785
}
786786
}
787-
if (/\.user\.js$/.test(location.pathname)) {
787+
if (!(/^file:\/\/\//.test(location.href)) && /\.user\.js$/.test(location.pathname)) {
788788
if (document.readyState == 'complete')
789789
checkJS();
790790
else

src/locale/cs-cz.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,14 @@ labelSearch:
305305
labelSearchFor:
306306
description: Text shown as a place holder in the search box.
307307
message: Hledat…
308+
touched: false
308309
labelReplace:
309310
description: Label for replace input in search box.
310311
message: 'Nahradit: '
311312
labelReplaceWith:
312313
description: Text shown as a place holder in the replace box.
313314
message: Nahradit čím…
315+
touched: false
314316
buttonReplace:
315317
description: Button to replace the current match.
316318
message: Nahradit
@@ -393,3 +395,6 @@ msgInvalidScript:
393395
menuScriptDisabled:
394396
description: 'Menu item showing the status of Violentmonkey, when disabled.'
395397
message: ''
398+
labelLineNumber:
399+
description: Label for line number jumper.
400+
message: ''

src/locale/en.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,14 @@ labelSearch:
303303
labelSearchFor:
304304
description: Text shown as a place holder in the search box.
305305
message: Search for...
306+
touched: false
306307
labelReplace:
307308
description: Label for replace input in search box.
308309
message: 'Replace with: '
309310
labelReplaceWith:
310311
description: Text shown as a place holder in the replace box.
311312
message: Replace with...
313+
touched: false
312314
buttonReplace:
313315
description: Button to replace the current match.
314316
message: Replace
@@ -391,3 +393,6 @@ msgInvalidScript:
391393
menuScriptDisabled:
392394
description: 'Menu item showing the status of Violentmonkey, when disabled.'
393395
message: Scripts disabled
396+
labelLineNumber:
397+
description: Label for line number jumper.
398+
message: 'Line no.: '

src/locale/fr-fr.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,14 @@ labelSearch:
303303
labelSearchFor:
304304
description: Text shown as a place holder in the search box.
305305
message: Search for...
306+
touched: false
306307
labelReplace:
307308
description: Label for replace input in search box.
308309
message: 'Replace with: '
309310
labelReplaceWith:
310311
description: Text shown as a place holder in the replace box.
311312
message: Replace with...
313+
touched: false
312314
buttonReplace:
313315
description: Button to replace the current match.
314316
message: Replace
@@ -393,3 +395,6 @@ msgInvalidScript:
393395
menuScriptDisabled:
394396
description: 'Menu item showing the status of Violentmonkey, when disabled.'
395397
message: ''
398+
labelLineNumber:
399+
description: Label for line number jumper.
400+
message: ''

src/locale/pl-pl.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,14 @@ labelSearch:
305305
labelSearchFor:
306306
description: Text shown as a place holder in the search box.
307307
message: Szukaj w...
308+
touched: false
308309
labelReplace:
309310
description: Label for replace input in search box.
310311
message: 'Zamień na: '
311312
labelReplaceWith:
312313
description: Text shown as a place holder in the replace box.
313314
message: Zamień na...
315+
touched: false
314316
buttonReplace:
315317
description: Button to replace the current match.
316318
message: Zamień
@@ -393,3 +395,6 @@ msgInvalidScript:
393395
menuScriptDisabled:
394396
description: 'Menu item showing the status of Violentmonkey, when disabled.'
395397
message: ''
398+
labelLineNumber:
399+
description: Label for line number jumper.
400+
message: ''

src/locale/ru-ru.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,14 @@ labelSearch:
303303
labelSearchFor:
304304
description: Text shown as a place holder in the search box.
305305
message: Найти для...
306+
touched: false
306307
labelReplace:
307308
description: Label for replace input in search box.
308309
message: 'Заменить на: '
309310
labelReplaceWith:
310311
description: Text shown as a place holder in the replace box.
311312
message: Заменить на...
313+
touched: false
312314
buttonReplace:
313315
description: Button to replace the current match.
314316
message: Заменить
@@ -391,3 +393,6 @@ msgInvalidScript:
391393
menuScriptDisabled:
392394
description: 'Menu item showing the status of Violentmonkey, when disabled.'
393395
message: ''
396+
labelLineNumber:
397+
description: Label for line number jumper.
398+
message: ''

0 commit comments

Comments
 (0)