RegExp
![]() ![]() |
Hello, i'm Griph (orion) fellow Uni
function checkContent( test) {
Although consider:
2. The whole script only uses checkContent once, you could ditch the function and just put /^https?:\/\//.test( test) inside the IF( ) in the fifth line of the findAndPlay() function 3. I strongly recommend you to use TEST function instead of indexOf for string comparison, like when you want to know in which page is being loaded, which screen like between the profile, building or starbase. First because it will make a cleaner code and because you avoid checking against >= 0 or != -1, as the TEST function already returns boolean. 4. Strictly speaking, the script says you could also put a File address but your current checkContent would not allow it, neither the one i wrote above but if you like this would also check and allow File: /^(https?|file):\/\//.test( string) To be honest i didn't install the script to test it, so i can't say it really doesn't allows File address, but that IF seems to filter it. |

