aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/generic-page-main.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-12-28 17:41:59 -0500
committerGitHub <noreply@github.com>2020-12-28 17:41:59 -0500
commitb6038c87b66630b341e431a4722856c9a3a282ed (patch)
tree721c26ef99b1e953904c10060c2a1bace281335e /ext/bg/js/generic-page-main.js
parentc03340c4aa77c0a84b28bf18407aa79972697213 (diff)
Improve document focus control (#1167)
* Improve styles for #content-scroll-focus * Create new class to manage and control document focus * Use new focus class * Add a check to prevent redundant .blur calls
Diffstat (limited to 'ext/bg/js/generic-page-main.js')
-rw-r--r--ext/bg/js/generic-page-main.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/bg/js/generic-page-main.js b/ext/bg/js/generic-page-main.js
index 8e1b3c76..29fcf63d 100644
--- a/ext/bg/js/generic-page-main.js
+++ b/ext/bg/js/generic-page-main.js
@@ -15,13 +15,18 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+/* global
+ * DocumentFocusController
+ */
+
function setupEnvironmentInfo() {
const {manifest_version: manifestVersion} = chrome.runtime.getManifest();
document.documentElement.dataset.manifestVersion = `${manifestVersion}`;
}
(() => {
- document.querySelector('#content-scroll-focus').focus();
+ const documentFocusController = new DocumentFocusController();
+ documentFocusController.prepare();
document.documentElement.dataset.loaded = 'true';
setupEnvironmentInfo();
})();