Skip to content

Commit

Permalink
fix: adjust api trigger mode
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangferry committed Jun 11, 2023
1 parent d65a4d1 commit 2e9d5c7
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
Binary file modified packages/SummarAI-chromium.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/chromium/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "SummarAI",
"version": "1.2.1",
"version": "1.2.2",
"homepage_url": "https://zhangferry.com",
"description": "This browser extension utilizes AI technology to analyze web pages and extract important information.",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion packages/chromium/options.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>Glarity</title>
<title>SummarAI</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="options.css" />
</head>
Expand Down
4 changes: 2 additions & 2 deletions packages/chromium/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -28494,7 +28494,6 @@ ${replylanguagePrompt("zh-CN")}
conversationId: ""
}
});
console.log(result);
}
return {};
} else {
Expand Down Expand Up @@ -28600,7 +28599,7 @@ ${replylanguagePrompt("zh-CN")}
providerConfig = providerConfig[configKey];
console.log(JSON.stringify(providerConfig));
let provider;
if (`${providerValue}` == "gpt") {
if (`${providerValue}` == "gpt3") {
const apiKey = providerConfig["apiKey"];
if (!apiKey) {
throw new Error(`You should config API Key first`);
Expand Down Expand Up @@ -28649,6 +28648,7 @@ ${replylanguagePrompt("zh-CN")}
await import_webextension_polyfill4.default.scripting.executeScript({ target: { tabId: tabs[0].id }, files: ["content.js"] });
const results = await import_webextension_polyfill4.default.tabs.sendMessage(tabs[0].id, { action: "getTextContent" });
const response = results && results.textContent ? results.textContent : "";
console.log(JSON.stringify(response));
await fetchData(response, type);
}
function setupEventListeners() {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "SummarAI",
"version": "1.2.1",
"version": "1.2.2",
"homepage_url": "https://zhangferry.com",
"description": "This browser extension utilizes AI technology to analyze web pages and extract important information.",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion src/options/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>Glarity</title>
<title>SummarAI</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="options.css" />
</head>
Expand Down
2 changes: 1 addition & 1 deletion src/popup/OpenAIProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class OpenAIProvider implements Provider {
messageId: "",
conversationId: ""
} })
console.log(result)
// console.log(result)
}
return {}
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/popup/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ document.addEventListener("DOMContentLoaded", () => {
console.log(JSON.stringify(providerConfig))

let provider: Provider
if (`${providerValue}` == "gpt") {
if (`${providerValue}` == "gpt3") {
const apiKey = providerConfig["apiKey"]
if (!apiKey) {
throw new Error(`You should config API Key first`)
Expand Down Expand Up @@ -149,6 +149,7 @@ document.addEventListener("DOMContentLoaded", () => {
await Browser.scripting.executeScript({target: {tabId: tabs[0].id}, files: ['content.js']})
const results = await Browser.tabs.sendMessage(tabs[0].id, {action: "getTextContent"})
const response = results && results.textContent ? results.textContent : ""
console.log(JSON.stringify(response))
await fetchData(response, type)
}

Expand Down

0 comments on commit 2e9d5c7

Please sign in to comment.