I am currently working on an user script made for YouTube using Firefoxs addon 'Greasemonkey' and came across a deadend.. Is it possible to check the url whether or not the url contains a specific string? I tried using indexOf() along with match() since I want it to check the string being case-insensitive..
My attempt with
if (window.location.href.indexOf(match(new RegExp("youtube.com/thumbnail?id=", "i"))) > -1) {
does not work however. I tried using contains() but it would return true as soon as the url has 'youtube' in it. Avoiding 'new RegExp' and only using match() does not work either, since I can't escape that forward slash in 'youtube.com/' with a backslash..