4chan-x/src/General/meta/metadata.js
ccd0 9c8f0e372c Use @include for better compatibility.
It shouldn't be any less safe as long as we keep wildcards out of
the scheme and host parts of the URL.
2015-06-23 12:01:51 -07:00

32 lines
1.2 KiB
JavaScript
Executable File

// ==UserScript==
// @name <%= meta.name %><%= meta.namesuffix[channel] %>
// @version <%= meta.version %>
// @minGMVer <%= meta.min.greasemonkey %>
// @minFFVer <%= meta.min.firefox %>
// @namespace <%= name %>
// @description <%= description %>
// @license MIT; <%= meta.repo %>blob/<%= meta.mainBranch %>/LICENSE
<%=
meta.matches.map(function(match) {
if (/^\*/.test(match)) {
return (
'// @include ' + match.replace(/^\*/, 'http') + '\n' +
'// @include ' + match.replace(/^\*/, 'https')
);
} else {
return '// @include ' + match;
}
}).join('\n')
%>
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_listValues
// @grant GM_openInTab
// @grant GM_xmlhttpRequest
// @run-at document-start
<% if (channel !== 'dev') { %><% if (channel !== 'noupdate') { %>// @updateURL <%= meta.downloads %><%= name %><%= meta.suffix[channel] %>.meta.js
<% } %>// @downloadURL <%= meta.downloads %><%= name %><%= meta.suffix[channel] %>.user.js
<% } %>// @icon data:image/png;base64,<%= grunt.file.read('src/General/img/icon48.png', {encoding: 'base64'}) %>
// ==/UserScript==