添加黑名单检查
This commit is contained in:
34
main.js
34
main.js
@@ -17,7 +17,8 @@ mdui.confirm(''
|
||||
+ '使用本工具<strong>不需要强制关注任何公众号或转发任何内容到朋友圈</strong>。如果你发现有公众号存在类似<strong>“关注○○,发送○○,转发○○到朋友圈领取○○”</strong>的行为,请对此类<strong>诱导行为</strong>进行<strong>投诉</strong>。'
|
||||
+ '<a href="https://mp.weixin.qq.com/cgi-bin/readtemplate?t=business/faq_operation_tmpl#3dot3_3" target="_blank">什么是诱导行为?</a>'
|
||||
+ '</p>'
|
||||
+ '<p>本工具生成的截图,仅可用于<strong>个人应付各类强制要求转发朋友圈的情形</strong>,请勿<strong>批量生成截图</strong>或将截图用于<strong>造谣诽谤、微商宣传</strong>等非法或令人反感的用途,请勿用于商业用途,二次部署请勿删除原作者相关信息。</p>'
|
||||
+ '<p>请勿以<strong>“关注○○,发送○○获取工具地址”</strong>或类似方式使用本工具为自己的公众号引流。如果想要推荐的话,请<strong>直接在正文里留下地址或二维码</strong>~</p>'
|
||||
+ '<p>本工具生成的截图,仅可用于<strong>个人应付各类强制要求转发朋友圈的情形</strong>,请勿<strong>批量生成截图</strong>或将截图用于<strong>造谣诽谤、微商宣传</strong>等非法或令人反感的用途,请勿用于商业用途,<strong>二次部署请勿删除原作者相关信息</strong>。</p>'
|
||||
+ '<p>当你生成截图时,你应该确定你可以接受向他人发送该截图将会带来的后果和影响,否则请不要使用本工具并离开当前页面。</p>'
|
||||
+ '<p>本工具谢绝肖战粉丝使用。<a href="https://w.url.cn/s/AC2atup" target="_blank">#我是普通人,我讨厌肖战#</a></p>'
|
||||
+ '</div>',
|
||||
@@ -31,6 +32,26 @@ mdui.confirm(''
|
||||
}
|
||||
);
|
||||
|
||||
var inBlacklist = [
|
||||
'www.41661.com',
|
||||
'41661.com',
|
||||
].indexOf(location.hostname) !== -1;
|
||||
|
||||
if (inBlacklist) {
|
||||
mdui.alert(
|
||||
'你所访问的网站(' + location.hostname + ')由于在转载本工具时抹去了原作者相关信息,已被原作者列入黑名单。点击下方按钮将跳转到原作者自己部署的页面。',
|
||||
function () {
|
||||
location.href = 'https://akarin.dev/WechatMomentScreenshot/';
|
||||
document.querySelector('.mdui-container').innerHTML = '';
|
||||
},
|
||||
{
|
||||
modal: true,
|
||||
closeOnEsc: false,
|
||||
history: false,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) loadScript('https://cdn.jsdelivr.net/gh/TransparentLC/WechatMomentScreenshot/fuckWechat.min.js');
|
||||
|
||||
if (!window.Promise) loadScript('https://cdn.jsdelivr.net/npm/promise-polyfill/dist/polyfill.min.js');
|
||||
@@ -445,10 +466,13 @@ document.getElementById('generate').addEventListener('click', function () {
|
||||
document.getElementById('generate').setAttribute('disabled', '');
|
||||
document.getElementById('generate').innerText = '生成中...';
|
||||
|
||||
html2canvas(document.getElementById('fakeWechatMoment'), {
|
||||
useCORS: true,
|
||||
scale: 1,
|
||||
}).then(function (canvas) {
|
||||
(inBlacklist ?
|
||||
Promise.reject('你所访问的网站(' + location.hostname + ')由于在转载本工具时抹去了原作者相关信息,已被原作者列入黑名单,无法生成截图。') :
|
||||
html2canvas(document.getElementById('fakeWechatMoment'), {
|
||||
useCORS: true,
|
||||
scale: 1,
|
||||
})
|
||||
).then(function (canvas) {
|
||||
var dURL = canvas.toDataURL();
|
||||
document.getElementById('generated').src = dURL;
|
||||
document.getElementById('save').setAttribute('href', dURL);
|
||||
|
||||
Reference in New Issue
Block a user