diff --git a/src/i_scripts.js b/src/i_scripts.js index feb8deb..d28a4bd 100644 --- a/src/i_scripts.js +++ b/src/i_scripts.js @@ -165,6 +165,17 @@ onrd.push(function(){ inputHandler.init_messageReceiver(); }); +onrd.push(function(){ + if (window.run_env != 'http_web') { + setTimeout(async function() { + var setting_autoSelectInputText = await get_addon_setting_local('autoSelectInputText') ; + + if (setting_autoSelectInputText !== false) + inputHandler.getInputFieldEle().select(); + }, 50); + } +}); + onrd.push(function(){ diff --git a/src/js/inputHandler.js b/src/js/inputHandler.js index ba85afa..948fa7f 100644 --- a/src/js/inputHandler.js +++ b/src/js/inputHandler.js @@ -66,6 +66,14 @@ function init_inputHandler() { if (request['command'] == "setInputBoxToText" && typeof(request['text']) === "string" ) inputHandler.init_mode( request['text'] ); } + + setTimeout(async function() { + var setting_autoSelectInputText = await get_addon_setting_local('autoSelectInputText') ; + + if (setting_autoSelectInputText !== false) + inputHandler.getInputFieldEle().select(); + }, 50); + }); }; diff --git a/src/manifest-chrome.json b/src/manifest-chrome.json index 68488cf..0c92bbd 100644 --- a/src/manifest-chrome.json +++ b/src/manifest-chrome.json @@ -3,7 +3,7 @@ "description": "__MSG_extensionDescription__", "default_locale": "en", "manifest_version": 2, - "version": "3.2.9", + "version": "3.2.16", "homepage_url": "https://github.com/garywill/BigSearch", "author": { "name": "Garywill", diff --git a/src/manifest.json b/src/manifest.json index 079c400..d4abf8c 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -3,7 +3,7 @@ "description": "__MSG_extensionDescription__", "default_locale": "en", "manifest_version": 2, - "version": "3.2.9", + "version": "3.2.16", "homepage_url": "https://garywill.github.io", "developer": { "name": "Garywill", diff --git a/src/options.html b/src/options.html index 3897e51..0076feb 100644 --- a/src/options.html +++ b/src/options.html @@ -63,10 +63,19 @@

- When context menu clicked (or keyword shortcut used), put selection text to clipboard also (need restart/reenable) + When context menu clicked (or keyboard shortcut used), put selection text to clipboard also (need restart/reenable)


+ +
+ Auto select text in inputbox when UI open +
+
+
+ + +

Show when new version available, at corner of addon page (need restart/reenable) diff --git a/src/options.js b/src/options.js index 52990dc..52a6e57 100755 --- a/src/options.js +++ b/src/options.js @@ -71,7 +71,17 @@ async function on_optionpage_load() { chrome.permissions.request( { permissions: ['clipboardWrite'] } , r=>console.log(r) ); }); } ) () ; - + // -------------------------- + (async () => { + var setting_autoSelectInputText = await get_addon_setting_local('autoSelectInputText') ; + + if (setting_autoSelectInputText !== false) + document.getElementById("cbox_autoSelectInputText").checked = true; + + document.getElementById("cbox_autoSelectInputText").addEventListener("change", function (event) { + chrome.storage.local.set({"autoSelectInputText" : event.target.checked}); + }); + } ) () ; // --------------------------