mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-09 13:16:05 +00:00
commit
4a46d6211c
|
@ -31,10 +31,6 @@
|
||||||
background-color: #f1f1f1;
|
background-color: #f1f1f1;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overflowingOverlayWidgets {
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -85,6 +81,7 @@
|
||||||
<script>
|
<script>
|
||||||
var editor;
|
var editor;
|
||||||
var currentFileName = "sayhello.js";
|
var currentFileName = "sayhello.js";
|
||||||
|
var serverBaseUrl = "http://localhost:3000";
|
||||||
|
|
||||||
function resizeEditor() {
|
function resizeEditor() {
|
||||||
if (editor) {
|
if (editor) {
|
||||||
|
@ -97,7 +94,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSuggestions(word, range) {
|
function getSuggestions(word, range) {
|
||||||
return axios.get("http://localhost:3000/completion/" + encodeURIComponent(word))
|
return axios.get(serverBaseUrl + "/completion/" + encodeURIComponent(word))
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
var parser = new XMLParser();
|
var parser = new XMLParser();
|
||||||
var result = parser.parse(response.data);
|
var result = parser.parse(response.data);
|
||||||
|
@ -249,7 +246,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
async function getTargetByUrl(urlPart) {
|
async function getTargetByUrl(urlPart) {
|
||||||
const response = await fetch('http://localhost:3000/devtools/json');
|
const response = await fetch(serverBaseUrl + "/devtools/json");
|
||||||
const targets = await response.json();
|
const targets = await response.json();
|
||||||
|
|
||||||
const target = targets.find(target => target.url.includes(urlPart));
|
const target = targets.find(target => target.url.includes(urlPart));
|
||||||
|
@ -286,7 +283,7 @@
|
||||||
id: 3,
|
id: 3,
|
||||||
method: 'Runtime.evaluate',
|
method: 'Runtime.evaluate',
|
||||||
params: {
|
params: {
|
||||||
expression: '((e)=>e[e.length-1].querySelector("code").innerText||e[e.length-1].innerText)(document.querySelectorAll("[data-content=ai-message]"))'
|
expression: '((e)=>e[e.length-1].querySelector("code")?.innerText||e[e.length-1].innerText)(document.querySelectorAll("[data-content=ai-message]"))'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -296,7 +293,7 @@
|
||||||
if (step.id == 3) {
|
if (step.id == 3) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
socket.send(JSON.stringify(step));
|
socket.send(JSON.stringify(step));
|
||||||
}, 7000);
|
}, 9000);
|
||||||
} else {
|
} else {
|
||||||
socket.send(JSON.stringify(step));
|
socket.send(JSON.stringify(step));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user