简体   繁体   English

在 JavaScript 中隐藏 URL f地址栏

[英]Hiding URL fAddress bar in JavaScript

Hi i want to hide url from address.嗨,我想从地址中隐藏 url。 i'm trying to download excel file but it's generating a new link and redirecting to new tab.我正在尝试下载 excel 文件,但它正在生成一个新链接并重定向到新选项卡。 when i copy and paste the same URL its downloading the same data.当我复制并粘贴相同的 URL 时,它会下载相同的数据。 to restrict that tried authentication and all.限制尝试过的身份验证和所有。 now i am trying to hide that URL i have tried with below code现在我试图隐藏我尝试使用以下代码的 URL

var winFeature = 'location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes'
window.open(result as string,winFeature); 

在此处输入图像描述

Sorry but the URL bar is part of window element of browser.抱歉,URL 栏是浏览器 window 元素的一部分。 You cannot change window's properties without affecting the whole tab's behaviour due to security issues.由于安全问题,您无法更改窗口的属性而不影响整个选项卡的行为。 You can hide the URL bar only if fullscreen.只有全屏时,您才能隐藏 URL 栏。 For that I recommend theMDN guide Also read this thread from Google Support为此我推荐MDN 指南也从谷歌支持阅读这个线程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM