feat: support Edge browser

This commit is contained in:
n4ze3m
2025-02-08 23:06:09 +05:30
parent 87c2024771
commit ef51cf85ff
10 changed files with 114 additions and 192 deletions

View File

@@ -24,7 +24,7 @@ const _getHtml = () => {
export const getDataFromCurrentTab = async () => {
const result = new Promise((resolve) => {
if (import.meta.env.BROWSER === "chrome") {
if (import.meta.env.BROWSER === "chrome" || import.meta.env.BROWSER === "edge") {
chrome.tabs.query({ active: true, currentWindow: true }, async (tabs) => {
const tab = tabs[0]

View File

@@ -1,6 +1,6 @@
const captureVisibleTab = () => {
const result = new Promise<string>((resolve) => {
if (import.meta.env.BROWSER === "chrome") {
if (import.meta.env.BROWSER === "chrome" || import.meta.env.BROWSER === "edge") {
chrome.tabs.query({ active: true, currentWindow: true }, async (tabs) => {
const tab = tabs[0]
chrome.tabs.captureVisibleTab(null, { format: "png" }, (dataUrl) => {

View File

@@ -6,7 +6,7 @@ export const urlRewriteRuntime = async function (
) {
if (browser.runtime && browser.runtime.id) {
const { isEnableRewriteUrl, rewriteUrl } = await getAdvancedOllamaSettings()
if (import.meta.env.BROWSER === "chrome") {
if (import.meta.env.BROWSER === "chrome" || import.meta.env.BROWSER === "edge") {
const url = new URL(domain)
const domains = [url.hostname]
let origin = `${url.protocol}//${url.hostname}`