From c7076ca316e28aa8a787b30066fe600c6c1342ef Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Sun, 10 Feb 2019 00:05:18 -0500 Subject: [PATCH] Trim token --- options/page.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/options/page.js b/options/page.js index fb09356..c4a2a88 100644 --- a/options/page.js +++ b/options/page.js @@ -15,9 +15,13 @@ document.querySelector('form') .addEventListener('submit', (e) => { e.preventDefault(); + let token = e.target['access_token'].value.trim(); + browser.storage.local.set({ - accessToken: e.target['access_token'].value, + accessToken: token, showNotifications: e.target['show_notifications'].checked, showNotificationsDecreased: e.target['show_notifications_decreased'].checked }); + + e.target['access_token'].value = token; });