prepareUrl = function (url, useembedVideos = true) {
  url = url.trim();
  if (!url) {
    return '';
  }

  // Search on google if not a URL
  if (!isUrl(url) && !isUrl(`http://${url}`)) {
    return `https://www.google.com/search?q=${url}`;
  }

  url = /^http(s)?:\/\//.test(url) || /^file:\/\/\//.test(url) ? url : `http://${url}`;

  // Magic URLs turn a normal link to embed link for some video streaming services,
  // return the normal URL if that is not required
  if (!useembedVideos) {
    return url;
  }

  url = prepareYoutubeUrl(url);
  url = prepareVimeoUrl(url);
  url = prepareTwitchUrl(url);
  url = prepareDailyMotionUrl(url);

  return url;
}
Prepares the given URL for loading in webview
@param url
@param useembedVideos
@return string