"],
+ "js": ["content.js"],
+ "css": ["styles/popup.css"]
+ }
+ ],
+ "icons": {
+ "16": "icons/icon-16x16.png",
+ "48": "icons/icon-48x48.png",
+ "128": "icons/icon-128x128.png"
+ }
+}
diff --git a/intergrations/extension_chrome/options.html b/intergrations/extension_chrome/options.html
new file mode 100644
index 000000000..b39625a76
--- /dev/null
+++ b/intergrations/extension_chrome/options.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+ RagFlow option
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/intergrations/extension_chrome/options.js b/intergrations/extension_chrome/options.js
new file mode 100644
index 000000000..d72a942d5
--- /dev/null
+++ b/intergrations/extension_chrome/options.js
@@ -0,0 +1,36 @@
+document.addEventListener("DOMContentLoaded", () => {
+
+ chrome.storage.sync.get(["baseURL", "from", "auth", "sharedID"], (result) => {
+ if (result.baseURL) {
+ document.getElementById("base-url").value = result.baseURL;
+ }
+ if (result.from) {
+ document.getElementById("from").value = result.from;
+ }
+ if (result.auth) {
+ document.getElementById("auth").value = result.auth;
+ }
+ if (result.sharedID) {
+ document.getElementById("shared-id").value = result.sharedID;
+ }
+ });
+
+ document.getElementById("save-config").addEventListener("click", () => {
+ const baseURL = document.getElementById("base-url").value;
+ const from = document.getElementById("from").value;
+ const auth = document.getElementById("auth").value;
+ const sharedID = document.getElementById("shared-id").value;
+
+ chrome.storage.sync.set(
+ {
+ baseURL: baseURL,
+ from: from,
+ auth: auth,
+ sharedID: sharedID,
+ },
+ () => {
+ alert("Successfully saved");
+ }
+ );
+ });
+});
diff --git a/intergrations/extension_chrome/popup.html b/intergrations/extension_chrome/popup.html
new file mode 100644
index 000000000..c69d01053
--- /dev/null
+++ b/intergrations/extension_chrome/popup.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ RAGFLOW
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/intergrations/extension_chrome/popup.js b/intergrations/extension_chrome/popup.js
new file mode 100644
index 000000000..0a8bdaba0
--- /dev/null
+++ b/intergrations/extension_chrome/popup.js
@@ -0,0 +1,24 @@
+document.addEventListener("DOMContentLoaded", () => {
+ chrome.storage.sync.get(["baseURL", "from", "auth", "sharedID"], (result) => {
+ if (result.baseURL && result.sharedID && result.from && result.auth) {
+ const iframeSrc = `${result.baseURL}chat/share?shared_id=${result.sharedID}&from=${result.from}&auth=${result.auth}`;
+ const iframe = document.querySelector("iframe");
+ iframe.src = iframeSrc;
+ }
+ });
+ chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
+ chrome.scripting.executeScript(
+ {
+ target: { tabId: tabs[0].id },
+ files: ["content.js"],
+ },
+ (results) => {
+ if (results && results[0]) {
+ const getHtml = document.getElementById("getHtml");
+ getHtml.value = results[0].result;
+
+ }
+ }
+ );
+ });
+});
diff --git a/intergrations/extension_chrome/styles/options.css b/intergrations/extension_chrome/styles/options.css
new file mode 100644
index 000000000..1e3ded675
--- /dev/null
+++ b/intergrations/extension_chrome/styles/options.css
@@ -0,0 +1,91 @@
+#ragflow {
+ font-family: "Segoe UI", Arial, sans-serif;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 600px;
+}
+
+#ragflow .window {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ flex: 1;
+ overflow: hidden;
+}
+#ragflow #form-config {
+ background-color: #fff;
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ overflow: hidden;
+}
+
+#ragflow .header {
+ background-color: #fff;
+ padding: 4px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ flex-direction: row;
+}
+
+#ragflow .header .title {
+ font-size: 16px;
+}
+
+#ragflow .header .logo {
+ width: 100px; /* Adjust size as needed */
+ height: auto;
+ margin-right: 10px;
+}
+
+#ragflow .content {
+ padding: 20px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+#ragflow label {
+ font-weight: bold;
+ margin-bottom: 5px;
+}
+
+#ragflow input,
+#ragflow select {
+ width: 100%;
+ padding: 8px;
+ margin-bottom: 15px;
+ border: 1px solid #ccc;
+ border-radius: 5px;
+ box-sizing: border-box;
+}
+
+#ragflow button {
+ background-color: #0078d4;
+ color: #fff;
+ padding: 10px;
+ border: none;
+ border-radius: 5px;
+ cursor: pointer;
+ font-size: 14px;
+}
+
+#ragflow button:hover {
+ background-color: #005bb5;
+}
+
+#ragflow #config-button {
+ display: flex;
+ position: absolute;
+ top: 2px;
+ right: 2px;
+ font-size: 22px;
+}
+#ragflow #config-button:hover {
+ cursor: pointer;
+}
diff --git a/intergrations/extension_chrome/styles/popup.css b/intergrations/extension_chrome/styles/popup.css
new file mode 100644
index 000000000..90134f8ad
--- /dev/null
+++ b/intergrations/extension_chrome/styles/popup.css
@@ -0,0 +1,20 @@
+#ragflow {
+ font-family: "Segoe UI", Arial, sans-serif;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 320px;
+}
+
+#ragflow .window {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ flex: 1;
+ overflow: hidden;
+}
+#ragflow #output {
+ position: absolute;
+}
\ No newline at end of file