Merge pull request #151 from CommanderRoot/rm-deprecated-substr

Replace deprecated String.prototype.substr()
This commit is contained in:
ray-lothian 2022-02-21 23:39:16 -05:00 committed by GitHub
commit 4cb37cea1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -333,7 +333,7 @@ const ua = {
const o = ua.object(null, windowId, tab.cookieStoreId); const o = ua.object(null, windowId, tab.cookieStoreId);
chrome.browserAction.setBadgeText({ chrome.browserAction.setBadgeText({
tabId, 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); const o = ua.object(tabId, undefined, cookieStoreId);
chrome.browserAction.setBadgeText({ chrome.browserAction.setBadgeText({
tabId, tabId,
text: o.platform ? o.platform.substr(0, 3) : 'BOT' text: o.platform ? o.platform.slice(0, 3) : 'BOT'
}); });
} }
}, },