From 368f3029ac31e85667cd0f0372da9cdd6f8dbc44 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Sun, 20 Feb 2022 19:30:58 +0100 Subject: [PATCH] Replace deprecated String.prototype.substr() String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() which works similarily but isn't deprecated. Signed-off-by: Tobias Speicher --- extension/firefox/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/firefox/common.js b/extension/firefox/common.js index e9e80ac..bcf2ad1 100644 --- a/extension/firefox/common.js +++ b/extension/firefox/common.js @@ -333,7 +333,7 @@ const ua = { const o = ua.object(null, windowId, tab.cookieStoreId); chrome.browserAction.setBadgeText({ tabId, - text: o && o.platform ? o.platform.substr(0, 3) : '' + text: o && o.platform ? o.platform.slice(0, 3) : '' }); })); } @@ -341,7 +341,7 @@ const ua = { const o = ua.object(tabId, undefined, cookieStoreId); chrome.browserAction.setBadgeText({ tabId, - text: o.platform ? o.platform.substr(0, 3) : 'BOT' + text: o.platform ? o.platform.slice(0, 3) : 'BOT' }); } },