function is_external_url(url, base, hash_routing) {
	if (url.origin !== origin || !url.pathname.startsWith(base)) {
		return true;
	}

	if (hash_routing) {
		if (url.pathname === base + '/' || url.pathname === base + '/index.html') {
			return false;
		}

		// be lenient if serving from filesystem
		if (url.protocol === 'file:' && url.pathname.replace(/\/[^/]+\.html?$/, '') === base) {
			return false;
		}

		return true;
	}

	return false;
}
Is external if
- origin different
- path doesn't start with base
- uses hash router and pathname is more than base
@param {URL} url
@param {string} base
@param {boolean} hash_routing