|
Post by account_disabled on Jan 28, 2024 22:08:26 GMT -6
我上次提出这个问题是在 2013 年,当时 Mozilla 决定从 Firefox 23 的选项对话框中删除“禁用 JavaScript”设置。主要原因是: 如果没有 JavaScript,现代网络的大部分内容都会崩溃。 它使用户免受自身伤害。很少有人知道 JavaScript 是什么,更不用说需要禁用它了。 那些确实需要的人可以在其他地方找到隐藏的选项。 禁用 JavaScript 仍然是知情者的一个选择。 这篇热门文章自 2013 年首次发布以来,已进行更新,以解决 JavaScript 领域发生的巨大变化。 用户会从禁用 JavaScript 中受益吗? Learn to Code with JavaScript 可能:请参阅我关闭 JavaScript 整整一周,这真是太棒了。如果没有 JavaScript,就会出现一个神奇的网络,而不会出现臃肿、广告、弹出窗口、cookie 警告、滚动劫持以及我们今天遇到的许多其他黑暗模式。 也有一些有感知问题的人出于必要而禁用了 JavaScript。很少有网站考虑可访问性指南,因此它仍然是减少可能导致迷失方向和恶心的运动和动画效果的最简单方法。 文章内容通常是可见的,但缺点是许多 Web 应用程序在没有 JavaScript 的情 WhatsApp 号码数据 况下会失败。有些提供降级体验,但可能会破坏商店、地图、游戏和社交网站。由现代仅客户端应用程序框架提供支持的内容网站可能只显示空白页面。 你能阻止用户禁用 JavaScript 吗? 不! 网站所有者或开发人员不可能强迫用户下载并运行 JavaScript。浏览器从您的服务器“拉取”文件;用户可以通过浏览器设置、代理方法、插件或一系列其他拦截选项来阻止这种情况的发生。 您的脚本也可以修改或禁用特定功能。永远记住,用户处于控制之中:这是他们的设备和连接。他们选择访问您的网站并可以忽略任何他们不想要的内容。 你能支持那些没有 JavaScript 的人吗? 很少有人主动禁用脚本。人们很容易认为这些用户应该得到他们(没有)得到的一切,但现实情况更成问题。JavaScript 很脆弱;您的脚本可能会因以下原因而中断: HTTP 请求失败 请求未完成 防火墙阻止了响应 服务提供商阻止或修改了脚本 浏览器插件拦截或修改了脚本 浏览器不支持您需要的代码或设施 另一个脚本引发错误,导致所有脚本停止执行 Learn to Code with JavaScript 这些问题在移动世界中尤其普遍,用户可能在旅行、使用功能较弱的设备、通过慢速网络连接、使用不稳定的机场 WiFi 等。 解决方案仍然是渐进增强。您可以检测 API/设施何时可用于: 避免运行会导致错误的代码,或者 加载实现相同功能的polyfill。 用户可以获得不一样的体验。那些在桌面上使用最新 Chrome 的用户可能会获得最高级别的功能。
|
|