code: function matchPatternToRegExp(pattern) {
  	if (pattern === '<all_urls>') { return (/^(?:https?|file|ftp|app):\/\//); } // TODO: this is from mdn, check if chrome behaves the same
  	const match = rMatchPattern.exec(pattern);
  	if (!match) { throw new TypeError(`"${ pattern }" is not a valid MatchPattern`); }
  	const [ , scheme, host, path, ] = match;
  	return new RegExp('^(?:'
  		+ (scheme === '*' ? 'https?' : escapeForRegExp(scheme)) +'://'
  		+ (host === '*' ? '[^/]+?' : escapeForRegExp(host).replace(/^\\\*\\./g, '(?:[^/]+?.)?'))
  		+ (path ? '/'+ escapeForRegExp(path).replace(/\\\*/g, '.*') : '/?')
  	+')$');
  }
docs: Transforms a valid match pattern into a regular expression which matches all URLs included by that pattern.
  Passes all examples and counter-examples listed here https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Match_patterns#Examples
  @param  {string}  pattern  The pattern to transform.
  @return {RegExp}           The patterns equivalent as a RegExp.
  @throws {TypeError}        If the pattern string is not a valid MatchPattern