fastchar-dom-plugin
Version:
Chrome插件,用于操作HTML的DOM
1 lines • 1.84 kB
JavaScript
(()=>{var t={81:(t,e,o)=>{var n;n=function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FastPopup=void 0,function(t){var e=function(){function e(){e.popupId=e.buildUDID()}return e.buildUDID=function(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var o=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?o:3&o|8).toString(16)}))},e.startConnect=function(){this.started=!0,chrome.tabs.query({active:!0},(function(e){t.Core.connectPort=chrome.tabs.connect(e[0].id,{name:"FastCharPopup@"}),t.Core.connectPort.onMessage.addListener((function(e){e.event&&"OnReturnMethod"===e.event&&t.Core.returnMethod(e)}))}))},e.postMessage=function(t){this.started||e.startConnect(),this.connectPort&&this.connectPort.postMessage(t)},e.invokeMethod=function(t,o){t.event="OnInvokeMethod",t.popupId=e.popupId,t.callbackId=this.buildUDID(),this.callbackMap[t.callbackId]=o,this.postMessage(t)},e.returnMethod=function(t){t.callbackId&&this.callbackMap[t.callbackId]&&this.callbackMap[t.callbackId](t.data)},e.callbackMap={},e.started=!1,e}();t.Core=e;var o=function(){function t(){}return t.getHtml=function(t,o){e.invokeMethod({method:"html",selectors:[t],params:[]},o)},t.getText=function(t,o){e.invokeMethod({method:"text",selectors:[t],params:[]},o)},t.setValue=function(t,o,n){e.invokeMethod({method:"val",selectors:[t],params:[o]},n)},t.getValue=function(t,o){e.invokeMethod({method:"val",selectors:[t],params:[]},o)},t.click=function(t,o){e.invokeMethod({method:"click",selectors:[t],params:[]},o)},t}();for(var n in t.Element=o,t)t[n]();window.FastPopup=t}(e.FastPopup||(e.FastPopup={}))}.apply(e,[o,e]),void 0===n||(t.exports=n)}},e={};!function o(n){var a=e[n];if(void 0!==a)return a.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,o),r.exports}(81)})();