انا استعمل متصفح brave 

manifest.json ملف
{
"name": "OpenAI Translate",
"version": "1.0.0",
"manifest_version": 2,
"description": "Uses OpenAI to instantly translate web pages to your language of choice.",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"permissions": [
"activeTab",
"tabs",
"http:///",
"https:///"
],
"background": {
"scripts": ["background.js"]
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"]
}
],
"web_accessible_resources": [
"options.html"
],
"options_ui": {
"page": "options.html",
"chrome_style": true
}
}

background.js:


// Define browser
var browser;
if (typeof chrome !== 'undefined') {
browser = chrome;
} else {
browser = browser;
}

// Get API key
var openaiKey = "";
browser.storage.local.get("openaiKey").then(function(result) {
openaiKey = result.openaiKey;
});

browser.runtime.onMessage.addListener(function(request, sender) {
// Make API request
fetch("...")
.then(function(res) {
return res.json();
})
.then(function(data) {
browser.tabs.sendMessage(sender.tab.id, data);
})
.catch(function(error) {
browser.tabs.sendMessage(sender.tab.id, { error });
});
});
options.html:



<!DOCTYPE html> <html> <body> <input id="key" type="text"> <button id="save">Save</button> <script> var saveButton = document.getElementById("save"); saveButton.addEventListener("click", function() { var key = document.getElementById("key").value; if(key == "") { alert("Please enter an API key."); return; } browser.storage.local.set({"openaiKey": key}).then(function() { alert("API key saved."); }); }); </script> </body> </html> Write your response with exactly 3 paragraphs, separated with the markdown divider: ***.
user