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 <rootcommander@gmail.com>
This commit is contained in:
parent
2edfc8cc07
commit
368f3029ac
1 changed files with 2 additions and 2 deletions
|
@ -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'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue