Skip to content

Commit

Permalink
fix: ms copilot
Browse files Browse the repository at this point in the history
  • Loading branch information
F33RNI committed May 15, 2024
1 parent e22253b commit 4e916e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/lmao/ms_copilot/conversationParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,16 @@ function actionHandle(action) {
const lastMessageGroupBot = getLastMessageGroupBot();
const cibMessages = lastMessageGroupBot.shadowRoot.querySelectorAll("cib-message");
for (const cibMessage of cibMessages) {
if (cibMessage.getAttribute("content") !== "IMAGE") {
if (cibMessage.hasAttribute("content") && cibMessage.getAttribute("content") !== "IMAGE") {
continue;
}
const cibMessageIframe = cibMessage.shadowRoot.querySelector("cib-shared > iframe");
if (cibMessageIframe === null) {
continue;
}
const iframeDocument = cibMessageIframe.contentWindow.document;
if (iframeDocument.querySelector("#giloader").getAttribute("style") === "display: flex;") {
const giLoader = iframeDocument.querySelector("#giloader");
if (giLoader && giLoader.getAttribute("style") === "display: flex;") {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lmao/ms_copilot/ms_copilot_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
# JS script that sets conversation style (WORKS ONLY ON NEW CONVERSATIONS). Pass 1 / 2 / 3 as argument
# (1 - Creative, 2 - Balanced, 3 - Precise)
_SET_STYLE = """
document.querySelector("#b_sydConvCont > cib-serp").shadowRoot.querySelector("#cib-conversation-main").shadowRoot.querySelector("#cib-chat-main > cib-welcome-container").shadowRoot.querySelector("div.controls > cib-tone-selector").shadowRoot.querySelector("#tone-options > li:nth-child(" + arguments[2] + ") > button").click();
document.querySelector("#b_sydConvCont > cib-serp").shadowRoot.querySelector("#cib-conversation-main").shadowRoot.querySelector("#cib-chat-main > cib-welcome-container").shadowRoot.querySelector("div.controls > cib-tone-selector").shadowRoot.querySelector("#tone-options > li:nth-child(" + arguments[0] + ") > button").click();
"""

# JS script that returns "Stop responding" button
Expand Down

0 comments on commit 4e916e7

Please sign in to comment.