|
|
@@ -4,6 +4,13 @@ var bg = chrome.extension.getBackgroundPage();
|
|
|
console.log(bg)
|
|
|
const serverUrl = 'https://going.run/assist'
|
|
|
|
|
|
+function owoReplaceAll(str, s1, s2) {
|
|
|
+ while (str.indexOf(s1) >= 0) {
|
|
|
+ str = str.replace(s1, s2)
|
|
|
+ }
|
|
|
+ return str
|
|
|
+}
|
|
|
+
|
|
|
const getSchemeData = new Promise((resolve, reject) => {
|
|
|
getCurrentTabId((tabInfo) => {
|
|
|
// alert(userInfo.username)
|
|
|
@@ -98,12 +105,33 @@ function load() {
|
|
|
message: '远程方案已载入并运行!'
|
|
|
})
|
|
|
// console.log(unescape(dataTemp.data))
|
|
|
+ function decodeOwo (value) {
|
|
|
+ value = owoReplaceAll(value, "'", 'owovar1')
|
|
|
+ value = owoReplaceAll(value, "`", 'owovar2')
|
|
|
+ value = owoReplaceAll(value, '"', 'owovar3')
|
|
|
+ value = owoReplaceAll(value, '$', 'owovar4')
|
|
|
+ return value
|
|
|
+ }
|
|
|
if (dataTempCopy.data) {
|
|
|
let execTwmp = `
|
|
|
+ function owoReplaceAll(str, s1, s2) {
|
|
|
+ while (str.indexOf(s1) >= 0) {
|
|
|
+ str = str.replace(s1, s2)
|
|
|
+ }
|
|
|
+ return str
|
|
|
+ }
|
|
|
+ function clearOwo (value) {
|
|
|
+ value = owoReplaceAll(value, 'owovar1', "'")
|
|
|
+ value = owoReplaceAll(value, 'owovar2', "\`")
|
|
|
+ value = owoReplaceAll(value, 'owovar3', '"')
|
|
|
+ value = owoReplaceAll(value, 'owovar4', '$')
|
|
|
+ return value
|
|
|
+ }
|
|
|
var script = document.createElement("script");
|
|
|
script.type = "text/javascript";
|
|
|
script.charset = "UTF-8";
|
|
|
- script.innerHTML = \`${unescape(dataTempCopy.data).replace(/\`/g,"\\'")}\`;
|
|
|
+ script.innerHTML = clearOwo(\`${decodeOwo(dataTempCopy.data)}\`);
|
|
|
+ console.log(script.innerHTML)
|
|
|
document.body.appendChild(script)
|
|
|
`
|
|
|
chrome.tabs.executeScript(dataTemp.tabInfo.id, {code: execTwmp})
|
|
|
@@ -163,6 +191,6 @@ function load() {
|
|
|
}
|
|
|
load()
|
|
|
|
|
|
-document.getElementsByClassName('.no-script')[0].onclick = function () {
|
|
|
- load()
|
|
|
-}
|
|
|
+// document.getElementsByClassName('.no-script')[0].addEventListener("click", function(){
|
|
|
+// load()
|
|
|
+// })
|