JS 获取浏览器路径

getParentUrl() {
    let url = null;
    if (window.parent !== window) {
        try {
            url = window.parent.window.location.href;
        }catch (e) {
            url = window.document.referrer;
        }
    }else{
        url = 'development';
    }
    return url;
}

你可能感兴趣的:(JS 获取浏览器路径)