diff --git a/annotate-page/sidebar/panel.js b/annotate-page/sidebar/panel.js index f4fdb46..2af8505 100644 --- a/annotate-page/sidebar/panel.js +++ b/annotate-page/sidebar/panel.js @@ -4,14 +4,14 @@ const contentBox = document.querySelector("#content"); /* Make the content box editable as soon as the user mouses over the sidebar. */ -window.addEventListener("mouseover", (e) => { +window.addEventListener("mouseover", () => { contentBox.setAttribute("contenteditable", true); }); /* When the user mouses out, save the current contents of the box. */ -window.addEventListener("mouseout", (e) => { +window.addEventListener("mouseout", () => { contentBox.setAttribute("contenteditable", false); browser.tabs.query({windowId: myWindowId, active: true}).then((tabs) => { let contentToStore = {}; diff --git a/apply-css/background.js b/apply-css/background.js index 7e936a0..3c0b1aa 100644 --- a/apply-css/background.js +++ b/apply-css/background.js @@ -51,7 +51,7 @@ When first loaded, initialize the page action for all tabs. */ var gettingAllTabs = browser.tabs.query({}); gettingAllTabs.then((tabs) => { - for (tab of tabs) { + for (let tab of tabs) { initializePageAction(tab); } }); diff --git a/commands/background.js b/commands/background.js index 825c559..a54dc95 100644 --- a/commands/background.js +++ b/commands/background.js @@ -12,7 +12,7 @@ */ var gettingAllCommands = browser.commands.getAll(); gettingAllCommands.then((commands) => { - for (command of commands) { + for (let command of commands) { console.log(command); } }); diff --git a/emoji-substitution/emojiMap.js b/emoji-substitution/emojiMap.js index 16c689e..b2f1b9e 100644 --- a/emoji-substitution/emojiMap.js +++ b/emoji-substitution/emojiMap.js @@ -2,6 +2,8 @@ * This file contains the Map of word --> emoji substitutions. */ +/* exported sortedEmojiMap */ + let dictionary = new Map(); dictionary.set('apple', '🍎'); dictionary.set('banana', '🍌'); diff --git a/emoji-substitution/substitute.js b/emoji-substitution/substitute.js index c886063..39203db 100644 --- a/emoji-substitution/substitute.js +++ b/emoji-substitution/substitute.js @@ -3,6 +3,8 @@ * all occurrences of each mapped word with its emoji counterpart. */ +/*global sortedEmojiMap*/ + // emojiMap.js defines the 'sortedEmojiMap' variable. // Referenced here to reduce confusion. const emojiMap = sortedEmojiMap; diff --git a/google-userinfo/background/authorize.js b/google-userinfo/background/authorize.js index 633c41b..b49bb72 100644 --- a/google-userinfo/background/authorize.js +++ b/google-userinfo/background/authorize.js @@ -1,3 +1,5 @@ +/* exported getAccessToken */ + const REDIRECT_URL = browser.identity.getRedirectURL(); const CLIENT_ID = "YOUR-CLIENT-ID"; const SCOPES = ["openid", "email", "profile"]; diff --git a/google-userinfo/background/main.js b/google-userinfo/background/main.js index ac70222..9ddf1fb 100644 --- a/google-userinfo/background/main.js +++ b/google-userinfo/background/main.js @@ -1,3 +1,5 @@ +/*global getAccessToken*/ + function notifyUser(user) { browser.notifications.create({ "type": "basic", diff --git a/google-userinfo/background/userinfo.js b/google-userinfo/background/userinfo.js index 84a5427..5f7ac1d 100644 --- a/google-userinfo/background/userinfo.js +++ b/google-userinfo/background/userinfo.js @@ -2,6 +2,9 @@ Fetch the user's info, passing in the access token in the Authorization HTTP request header. */ + +/* exported getUserInfo */ + function getUserInfo(accessToken) { const requestURL = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json"; const requestHeaders = new Headers(); diff --git a/history-deleter/history.js b/history-deleter/history.js index 11a1dff..798f8db 100644 --- a/history-deleter/history.js +++ b/history-deleter/history.js @@ -7,7 +7,7 @@ function get_hostname(url) { } function set_domain(domain) { - spans = document.getElementsByClassName('domain'); + const spans = document.getElementsByClassName('domain'); [].slice.call(spans).forEach((span) => { span.textContent = domain; }); @@ -65,7 +65,7 @@ function clearAll(e) { // Loop through them and delete them one by one. var searchingHistory = browser.history.search({text: hostname}) searchingHistory.then((results) => { - for (k = 0; k < results.length; k++) { + for (let k of results) { browser.history.deleteUrl({url: results[k].url}); } // Clear out the UI. diff --git a/list-cookies/cookies.js b/list-cookies/cookies.js index 74c5a84..db2fc8e 100644 --- a/list-cookies/cookies.js +++ b/list-cookies/cookies.js @@ -1,6 +1,6 @@ function showCookiesForTab(tabs) { //get the first tab object in the array - tab = tabs.pop(); + let tab = tabs.pop(); //get all cookies in the domain var gettingAllCookies = browser.cookies.getAll({url: tab.url}); @@ -14,22 +14,22 @@ function showCookiesForTab(tabs) { if (cookies.length > 0) { //add an