diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 57dbdf4c..73eb7d95 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -74,6 +74,21 @@ "description": "" }, + "prefs_OptionText_chatgpt_win_text": { + "message": "ChatGPT window dimensions", + "description": "" + }, + + "prefs_OptionText_chatgpt_win_height": { + "message": "Height", + "description": "" + }, + + "prefs_OptionText_chatgpt_win_width": { + "message": "Width", + "description": "" + }, + "prefsInfoTitle": { "message": "Important Information", "description": "" diff --git a/_locales/it/messages.json b/_locales/it/messages.json index d18de435..b5c7c5c0 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -74,6 +74,21 @@ "description": "" }, + "prefs_OptionText_chatgpt_win_text": { + "message": "Dimensioni della finestra di ChatGPT", + "description": "" + }, + + "prefs_OptionText_chatgpt_win_height": { + "message": "Altezza", + "description": "" + }, + + "prefs_OptionText_chatgpt_win_width": { + "message": "Larghezza", + "description": "" + }, + "prefsInfoTitle": { "message": "Informazioni Importanti", "description": "" diff --git a/mzta-background.js b/mzta-background.js index 2e0ef7b9..38ee7d84 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -1,4 +1,5 @@ import { mzta_script } from './js/mzta-chatgpt.js'; +import { prefs_default } from './options/mzta-options-default.js'; var createdWindowID = null; @@ -71,12 +72,13 @@ messenger.runtime.onMessage.addListener((message, sender, sendResponse) => { }); -function openChatGPT(promptText,action,curr_tabId){ +async function openChatGPT(promptText,action,curr_tabId){ + let prefs = await browser.storage.sync.get(prefs_default); return browser.windows.create({ url: "https://chat.openai.com", type: "popup", - width: 700, - height: 800 + width: prefs.chatgpt_win_width, + height: prefs.chatgpt_win_height }).then((newWindow) => { console.log("Script started..."); createdWindowID = newWindow.id; diff --git a/options/mzta-options-default.js b/options/mzta-options-default.js new file mode 100644 index 00000000..9f9aa5f1 --- /dev/null +++ b/options/mzta-options-default.js @@ -0,0 +1,4 @@ +export const prefs_default = { + chatgpt_win_height: 800, + chatgpt_win_width: 700, +} \ No newline at end of file diff --git a/options/mzta-options.html b/options/mzta-options.html index 5865e34f..32634998 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -6,8 +6,11 @@
-