var _hostname, _origin, _host, _protocol, _port, _pathname, _search, _hash;
Object.defineProperties(location, {
    host: {
        set: function (arg) {
            _hostname = arg
        }, get: function () {
            return _hostname
        }, enumerable: true
    },
    toString: {
        value: v_saf(function toString() {
            return ''
        }),
        enumerable: true,

    },
    reload: {
        value: v_saf(function reload() {

        }),
        enumerable: true,

    },
    port: {
        set: function (arg) {
            _port = arg
        }, get: function () {
            return _port
        }, enumerable: true
    },
    origin: {
        set: function (arg) {
            _origin = arg
        }, get: function () {
            return _origin
        }, enumerable: true
    },
    pathname: {
        set: function (arg) {
            _pathname = arg
        }, get: function () {
            return _pathname
        }, enumerable: true
    },
    href: {
        value: 'https://www.southwest.com/air/booking/index.html?adultPassengersCount=1&adultsCount=1&departureDate=2023-07-13&departureTimeOfDay=ALL_DAY&destinationAirportCode=BOS&fareType=POINTS&int=HOMEQBOMAIR&originationAirportCode=LAS&passengerType=ADULT&reset=true&returnDate=&returnTimeOfDay=ALL_DAY&tripType=oneway&validate=true',
        enumerable: true
    },

    hash: {
        set: function (arg) {
            _hash = arg
        }, get: function () {
            return _hash
        }, enumerable: true
    },
    protocol: {
        set: function (arg) {
            _protocol = arg
        }, get: function () {
            return _protocol
        }, enumerable: true
    },
    search: {
        set: function (arg) {
            _pathname = arg
        }, get: function () {
            return _pathname
        }, enumerable: true
    },
    assign: {
        value: v_saf(function assign() {

        }),
        enumerable: true,

    },
    replace: {
        value: v_saf(function replace() {

        }),
        enumerable: true,
    },
    hostname: {
        set: function (arg) {
            _hostname = arg
        }, get: function () {
            return _hostname
        }, enumerable: true
    },
    ancestorOrigins: {
        get: v_saf(function ancestorOrigins() {
            return new DOMStringList()
        }),
        enumerable: true,
        configurable: false
    },
})
location.href = 'https://www.southwest.com/air/booking/index.html?adultPassengersCount=1&adultsCount=1&departureDate=2023-07-13&departureTimeOfDay=ALL_DAY&destinationAirportCode=BOS&fareType=POINTS&int=HOMEQBOMAIR&originationAirportCode=LAS&passengerType=ADULT&reset=true&returnDate=&returnTimeOfDay=ALL_DAY&tripType=oneway&validate=true'

function set_href(v, href) {
    href = href.trim()
    v_console_log(`  href[set]:`, JSON.stringify(href))
    if (href.startsWith("http://") || href.startsWith("https://")) {/*ok*/
    } else if (href.startsWith("//")) {
        href = (v.protocol ? v.protocol : 'http:') + href
    } else {
        href = v.protocol + "//" + v.host + (v.port ? ":" + v.port : "") + '/' + ((href[0] == '/') ? href.slice(1) : href)
    }
    var a = href.match(/([^:]+:)\/\/([^/:?#]+):?(\d+)?([^?#]*)?(\?[^#]*)?(#.*)?/);
    v.protocol = a[1] ? a[1] : "";
    v.host = a[2] ? a[2] : "";
    v.port = a[3] ? a[3] : "";
    v.pathname = a[4] ? a[4] : "";
    v.search = a[5] ? a[5] : "";
    v.hash = a[6] ? a[6] : "";
    v.hostname = v.host;
    v.origin = v.protocol + "//" + v.host + (v.port ? ":" + v.port : "");
}

// 'valueOf,ancestorOrigins,href,origin,protocol,host,hostname,port,pathname,search,hash,assign,reload,replace,toString'
set_href(location, 'https://www.southwest.com/air/booking/index.html?adultPassengersCount=1&adultsCount=1&departureDate=2023-07-13&departureTimeOfDay=ALL_DAY&destinationAirportCode=BOS&fareType=POINTS&int=HOMEQBOMAIR&originationAirportCode=LAS&passengerType=ADULT&reset=true&returnDate=&returnTimeOfDay=ALL_DAY&tripType=oneway&validate=true')
window.location = location
// window.location = new Proxy(location, {
//     get(target, p, receiver) {
//         console.log('locaiton get', p)
//         return Reflect.get(target, p, receiver)
//     },
//     has(target, p) {
//         let res = Reflect.has(target, p);
//         console.log('locaiton has', p, res)
//         return res;
//     },
//     getOwnPropertyDescriptor(target, p) {
//         let res = Reflect.getOwnPropertyDescriptor(target, p);
//
//         console.log('locaiton getOwnPropertyDescriptor', p, res)
//         return res;
//     }
// })

origin = location.origin