添加黑名单检查
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
# WechatMomentScreenshot
|
||||
|
||||
[](http://hits.dwyl.io/TransparentLC/WechatMomentScreenshot)
|
||||
|
||||
朋友圈转发截图生成工具
|
||||
|
||||
[去这里使用](https://transparentlc.github.io/WechatMomentScreenshot)
|
||||
@@ -20,7 +18,11 @@
|
||||
>
|
||||
> * 由 [@794TD](https://github.com/794TD) 提供:https://wl.shadiaoforever.xyz/
|
||||
>
|
||||
> 本工具是开源的,如果有人愿意自己部署镜像站并分享给大家使用,那就太棒了!你可以通过 Issue 提交镜像站地址,二次部署时请不要删除原作者相关信息。
|
||||
> 本工具是开源的,如果有人愿意自己部署镜像站并分享给大家使用,那就太棒了!你可以通过 Issue 提交镜像站地址,**二次部署时请不要删除原作者相关信息**。
|
||||
>
|
||||
> 以下网站二次部署时抹去了原作者相关信息,原作者对此表示非常遗憾,在此列出来批判一番:
|
||||
>
|
||||
> * h**ps://www.41661.com/ 甚至还替换了赞赏的收款码
|
||||
|
||||
---
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -347,9 +347,9 @@
|
||||
</div>
|
||||
|
||||
<div class="mdui-m-y-2" style="text-align:center;line-height:1.5em">
|
||||
<a href="https://github.com/TransparentLC/WechatMomentScreenshot" target="_blank" style="text-decoration:none"><img src="https://img.shields.io/github/stars/TransparentLC/WechatMomentScreenshot.svg?style=social" /> <img src="https://camo.githubusercontent.com/cdd9212da6fa5f588cee15ca9f7e750928031f73/687474703a2f2f686974732e6477796c2e696f2f5472616e73706172656e744c432f5765636861744d6f6d656e7453637265656e73686f742e737667" style="border-radius: 2px;" /></a>
|
||||
<a href="https://github.com/TransparentLC/WechatMomentScreenshot" target="_blank" style="text-decoration:none"><img src="https://img.shields.io/github/stars/TransparentLC/WechatMomentScreenshot.svg?style=social"></a>
|
||||
<br>
|
||||
<span class="mdui-typo-caption-opacity">© 2020 ✨小透明・宸✨</span>
|
||||
<span class="mdui-typo-caption-opacity">© 2021 ✨小透明・宸✨</span>
|
||||
</div>
|
||||
|
||||
<div id="addComment" class="mdui-dialog">
|
||||
|
||||
28
main.js
28
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 = '生成中...';
|
||||
|
||||
(inBlacklist ?
|
||||
Promise.reject('你所访问的网站(' + location.hostname + ')由于在转载本工具时抹去了原作者相关信息,已被原作者列入黑名单,无法生成截图。') :
|
||||
html2canvas(document.getElementById('fakeWechatMoment'), {
|
||||
useCORS: true,
|
||||
scale: 1,
|
||||
}).then(function (canvas) {
|
||||
})
|
||||
).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