parent
05155123ac
commit
485666b68a
4 changed files with 22 additions and 2 deletions
|
|
@ -94,6 +94,11 @@
|
|||
"description": ""
|
||||
},
|
||||
|
||||
"prefs_OptionText_default_sign_name": {
|
||||
"message": "Default signature name",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
"prefsInfoTitle": {
|
||||
"message": "Important Information",
|
||||
"description": ""
|
||||
|
|
|
|||
|
|
@ -94,6 +94,12 @@
|
|||
"description": ""
|
||||
},
|
||||
|
||||
"prefs_OptionText_default_sign_name": {
|
||||
"message": "Nome predefinito della firma",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
|
||||
"prefsInfoTitle": {
|
||||
"message": "Informazioni Importanti",
|
||||
"description": ""
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ const addAction = (curr_prompt, promptsContainer) => {
|
|||
}
|
||||
//open chatgpt window
|
||||
//console.log("Click menu item...");
|
||||
var fullPrompt = curr_prompt.text + " " + browser.i18n.getMessage("prompt_lang") + browser.i18n.getMessage("prompt_translate_lang") + " \"" + msg_text.text + "\" ";
|
||||
var fullPrompt = curr_prompt.text + " " + await getDefaultSignature() + " " + browser.i18n.getMessage("prompt_lang") + browser.i18n.getMessage("prompt_translate_lang") + " \"" + msg_text.text + "\" ";
|
||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||
browser.runtime.sendMessage({command: "chatgpt_open", prompt: fullPrompt, action: curr_prompt.action, tabId: tabs[0].id});
|
||||
};
|
||||
|
|
@ -44,6 +44,15 @@ const addAction = (curr_prompt, promptsContainer) => {
|
|||
promptsContainer.appendChild(promptDiv);
|
||||
};
|
||||
|
||||
async function getDefaultSignature(){
|
||||
let prefs = await browser.storage.sync.get({default_sign_name: ''});
|
||||
if(prefs.default_sign_name===''){
|
||||
return '';
|
||||
}else{
|
||||
return "Sign the message as " + prefs.default_sign_name + ".";
|
||||
}
|
||||
}
|
||||
|
||||
async function checkCompose(){
|
||||
return await browser.windows.getCurrent().then((currWindow) => {
|
||||
//console.log("currWindow.type: "+currWindow.type);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<label><input type="number" id="chatgpt_win_height" name="chatgpt_win_height" class="option-input" /> __MSG_prefs_OptionText_chatgpt_win_height__</label><br/>
|
||||
<input type="number" id="chatgpt_win_width" name="chatgpt_win_width" class="option-input" /> __MSG_prefs_OptionText_chatgpt_win_width__</label><br/>
|
||||
<br/>
|
||||
<label><input type="text" id="default_sign_name" name="default_sign_name" class="option-input" /> Default signature name</label></div>
|
||||
<label><input type="text" id="default_sign_name" name="default_sign_name" class="option-input" /> __MSG_prefs_OptionText_default_sign_name__</label></div>
|
||||
<div id="miczDescription">
|
||||
<h1>__MSG_prefsInfoTitle__</h1>
|
||||
<p>__MSG_prefsInfoDesc_1__<br/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue