javascript - 使窗口在 Chrome 中不可调整大小

标签 javascript google-chrome

<分区>

我有一些 JavaScript 用于使窗口不可调整大小,大致如下:

window.open(URL, id, "resizable=no");

这适用于大多数浏览器,但在 Chrome 中似乎不受支持。我考虑过使用 JavaScript 来观察大小调整并将其设置回去,但这并不理想。有人有其他建议吗?提前致谢。

最佳答案

不久之前,使用带有弹出窗口和“resizable = 0”参数的旧 javascript 很容易做到这一点,但当前的浏览器不允许这样做,因为它们扼杀了用户的自由。这个倡议从 firefox 开始,chrome 紧随其后,可能这种情况的解决方案是创建一个 chrome 扩展,它只适用于 chrome,但这似乎很疯狂。

After some discussions, the consensus seems to be that window.open() should not be modified to parse "resizeable", at least at this time. The change would require modifications to Webkit, and the behavior would be inconsistent with Firefox and existing Webkit browsers.

see more here

We always allow a window to be resized, which is consistent with Firefox.

see more here

关于javascript - 使窗口在 Chrome 中不可调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15480252/

相关文章:

javascript - typescript 从其他属性的类型推断 prop 类型

javascript - 如何将 JSON 字符串转换为 JS 对象并检查属性值?

javascript - 如何从 php 服务器获取带有 $.ajax 的 zip

javascript - 如何在 .hbs 文件中执行 sql 查询,就像我们使用 php 执行 for .html 一样?

javascript - AngularJS 之外的 AngularJS 的 document.ready 替代方案

javascript - D3.js 如何将选择嵌入到新元素中

javascript - 谷歌浏览器扩展帮助 : change the background-color of the clicked tag

javascript - 谷歌浏览器 Javascript 调试器

javascript - 使用 puppeteer 或 playwright,有没有办法更新最初在启动方法中传递的参数?

javascript - 如何在Puppeteer中实现page.type()?