mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-15 21:55:36 +07:00
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 startsWith() or endsWith() Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
@@ -288,7 +288,7 @@ function decodeURL(url) {
|
||||
}
|
||||
|
||||
// Required (e.g., to fix https://github.com/ClearURLs/Addon/issues/71)
|
||||
if(rtn.substr(0, 4) !== 'http') {
|
||||
if(!rtn.startsWith('http')) {
|
||||
rtn = 'http://'+rtn
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user