微信编辑器爆破

无视微信编辑器VIP限制,可以使用VIP模板(135,96,wxeditor,主编,壹伴)

当前为 2021-05-08 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         微信编辑器爆破
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  无视微信编辑器VIP限制,可以使用VIP模板(135,96,wxeditor,主编,壹伴)
// @author       Yim @ [email protected]
// @match        *://*.135editor.com
// @match        *://bj.96weixin.com
// @match        *://www.wxeditor.com
// @match        *://www.zhubian.com
// @match        *://yibanbianji.com
// @match        *://*.yibanbianji.com
// @run-at 		 document-end
// @grant    	 unsafeWindow
// @require		 https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...
	let setting={
		item:null,
	};
    var lists=[];
	function init(){
		var host = window.location.host;
        console.log('Hack=>'+host);
		if(host.search(/www.135editor.com/)>=0) init135();
        if(host.search(/bj.96weixin.com/)>=0) init96();
        if(host.search(/www.wxeditor.com/)>=0) initYD();
        if(host.search(/www.zhubian.com/)>=0) initZB();
		if(host.search(/yibanbianji.com/)>=0) initYB();
	}
	function addStyle(cssText) {
		let a = document.createElement('style');
		a.textContent = cssText;
		let doc = document.head || document.documentElement;
		doc.appendChild(a);
	}
	function init135(){
		 $('<div class="ym_wx_plus_btn">点我使用</div>').appendTo('body').on('click',function(){
			if(!setting.item) return false;
            var h=setting.item.find('._135editor').html();
			if(h) unsafeWindow.current_editor.execCommand('inserthtml',h);
		});
        $("body").on('mousemove',function(event){
			var mouseX = event.pageX,mouseY = event.pageY;
            var ele = $(event.target).parents('li.style-item');
			if(ele.length==0){
                if(!$(event.target).hasClass('ym_wx_plus_btn'))$('.ym_wx_plus_btn').hide();
                return false;
            }
			var y1 = ele.offset().top;
			var y2 = y1 + ele.height();
			var x1 = ele.offset().left;
			var x2 = x1 + ele.width();
			if( mouseX < x1 || mouseX > x2 || mouseY < y1 || mouseY > y2){
				$('.ym_wx_plus_btn').hide();
				setting.item=null;
			}else{
				$('.ym_wx_plus_btn').css('left',(x2-120)+'px').css('top',(y1)+'px').show();
				setting.item=ele;
			}
		});
	}
    function init96(){
        setInterval(function(){
            $('.rich_media_content').attr('data-vip',1);
        },2000);
    }
    function initYD(){
        setInterval(function(){
            $('.yead_editor').attr('data-use',1);
        },2000);
    }
    function initZB(){
        setInterval(function(){
            $('.rich_media_content').attr('data-vip',1);
        },2000);
    }
	function initYB(){
        $('<div class="ym_wx_plus_btn">点我使用</div>').appendTo('body').on('click',function(){
			if(!setting.item) return false;
            var ue = UE.getEditor('ueditor-container');
			var h=setting.item.find('.html-container').html();
			if(h) ue.setContent(h, true);
		});
        $("body").on('mousemove',function(event){
            var mouseX = event.pageX,mouseY = event.pageY;
			var ele = $(event.target).parents('.material-item');
			if(ele.length==0){
                if(!$(event.target).hasClass('ym_wx_plus_btn'))$('.ym_wx_plus_btn').hide();
                return false;
            }
			var y1 = ele.offset().top;
			var y2 = y1 + ele.height();
			var x1 = ele.offset().left;
			var x2 = x1 + ele.width();
            console.log('mouseX:',mouseX,x1);
            console.log('mouseX:',mouseX,x2);
            console.log('mouseY:',mouseY,y1);
            console.log('mouseY:',mouseY,y2);
			if( mouseX < x1 || mouseX > x2 || mouseY < y1 || mouseY > y2){
				$('.ym_wx_plus_btn').hide();
				setting.item=null;
			}else{
				$('.ym_wx_plus_btn').css('left',(x2-120)+'px').css('top',(y1)+'px').show();
				setting.item=ele;
			}
		});
    }
	addStyle(`
	.ym_wx_plus_btn{position:absolute;display:none;left:0;top:0;cursor:pointer;width:120px;height:30px;line-height:30px;background:#f00;color:#fff;text-align:center;z-index:99999999;}
	`);
	init();
})();