Warn users about outdated versions of Greasemonkey.

This commit is contained in:
Mayhem 2013-11-02 19:20:28 +01:00
parent db29673648
commit a22bce79ab
4 changed files with 18 additions and 4 deletions

View File

@ -13,7 +13,12 @@
"*://boards.4chan.org/*",
"*://images.4chan.org/*",
"*://sys.4chan.org/*"
]
],
"min": {
"chrome": "29",
"firefox": "22",
"greasemonkey": "1.12"
}
},
"devDependencies": {
"font-awesome": "https://github.com/FortAwesome/Font-Awesome/archive/v4.0.0.tar.gz",

View File

@ -195,6 +195,15 @@ Main =
Main.disableReports = true
alert '4chan X v2 detected: Disable it or v3 will break.'
<% if (type === 'userscript') { %>
GMver = GM_info.version.split '.'
for v, i in "<%= meta.min.greasemonkey %>".split '.'
break if v < GMver[i]
continue if v is GMver[i]
new Notice 'warning', "Your version of Greasemonkey is outdated (v#{GM_info.version} instead of v<%= meta.min.greasemonkey %> minimum) and <%= meta.name %> may not operate correctly.", 30
break
<% } %>
try
localStorage.getItem '4chan-settings'
catch err

View File

@ -15,7 +15,7 @@
"run_at": "document_start"
}],
"homepage_url": "<%= meta.page %>",
"minimum_chrome_version": "29",
"minimum_chrome_version": "<%= meta.min.chrome %>",
"permissions": [
"storage"
]

View File

@ -1,8 +1,8 @@
// ==UserScript==
// @name <%= meta.name %>
// @version <%= version %>
// @minGMVer 1.13
// @minFFVer 22
// @minGMVer <%= meta.min.greasemonkey %>
// @minFFVer <%= meta.min.firefox %>
// @namespace <%= name %>
// @description <%= description %>
// @license MIT; <%= meta.repo %>blob/<%= meta.mainBranch %>/LICENSE