Firefox 浏览器附加组件
  • 扩展
  • 主题
    • 适用于 Firefox
    • 字典和语言包
    • 其他浏览器网站
    • 适用于 Android 的附加组件
登录
Immersive Web App (Singleton & Fullscreen) 预览

Immersive Web App (Singleton & Fullscreen) 作者: 幻灭文学出版社

Web App 体验增强助手:自动开启全屏,并修正链接跳转行为。建议搭配 Gesturefy 鼠标手势扩展以获得极致体验。 Web App Companion: Automates fullscreen and fixes link behavior. Recommended to pair with Gesturefy for the ultimate browsing experience.

0(0 条评价)0(0 条评价)
1 个用户1 个用户
下载 Firefox 并安装扩展
下载文件

扩展元数据

关于此扩展
Immersive Web App 是一款专为 Firefox 设计的高性能增强工具,旨在修复 Web App(“安装网站为应用”)模式下的交互断层。本扩展通过底层的逻辑补丁,确保您的网页应用在全屏状态下运行,且所有内容交互始终保持在独立的窗口容器内。

以下是该扩展核心功能的实现技术细节:
  1. 智能环境感知与自动化全屏 (Automated Fullscreen)
    实现原理:扩展利用 CSS 媒体查询接口 window.matchMedia 实时监测当前的显示模式(如 standalone 或 minimal-ui)。
    技术细节:一旦检测到网页运行在应用容器中,Content Script 将通过异步消息机制通知后台脚本。后台脚本调用 Firefox 原生的 browser.windows.update API,将当前窗口状态原子化地更新为 fullscreen。
    优化:该过程包含“成功即销毁”逻辑,一旦锁定全屏,相关的监听器将自动从内存中移除,实现零持续占用。
  2. JIT (即时) 跳转拦截技术 (Link "Escape" Fix)
    实现原理:针对 target="_blank" 导致的窗口逃逸问题,我们采用了 JIT (Just-In-Time) 拦截策略,取代了高耗能的 DOM 持续扫描。
    技术细节:在顶层 document 挂载一个处于“捕获阶段”(Capture Phase) 的全局点击监听器。在用户手指按下的微秒级时间内,脚本会向上遍历 DOM 路径。
    逻辑闭环:如果识别到目标链接,脚本会即时剥离其 target 属性,并检查全局 base 标签状态。若判定为新窗口行为,则将其重定向至当前窗口加载。这种方式完美兼容 React/Vue 的内部路由,不会产生任何页面闪烁。
  3. 跨沙箱 API 虚拟化 (window.open Interception)
    实现原理:针对脚本触发的 window.open,扩展利用了 Firefox Gecko 引擎特有的高级特性。
    技术细节:放弃了易被 CSP 安全策略阻断的 DOM 注入,改用 exportFunction 和 wrappedJSObject 接口。我们将沙箱内的安全拦截逻辑直接导出至网页主世界的全局作用域。
    结果:这使得扩展能够以“原生”的速度劫持 window.open 调用,在不触发任何 CSP 违规报错的前提下,将所有弹窗请求安全地引导至当前沉浸式窗口。
  4. 高性能与隐私保护 (Performance & Privacy)
    无感知运行:彻底废弃了 MutationObserver 等重度轮询技术。整个扩展的点击寻址算法复杂度极低 (O(log N)),在标准硬件上执行耗时小于 0.1ms。
    纯本地处理:所有拦截逻辑均在本地浏览器进程中完成。本扩展不申请联网权限,不访问剪贴板,不收集、不存储、不传输任何用户行为数据。

进阶使用建议:
为了获得更极致的体验,我们强烈建议将本扩展与 Gesturefy 等鼠标手势扩展配合使用。在全屏模式下,通过手势即可轻松完成前进、后退操作,让 Web App 的交互如同原生软件般丝滑。

关于开发:
本扩展由我和 Gemini 共同协作开发,结合了人类的创意构思与 AI 的架构优化。

Immersive Web App is a high-performance utility specifically engineered for Firefox to bridge the interactive gaps in the native "Install Site as App" (PWA) mode. By implementing low-level logic patches, it ensures your web applications remain in a seamless fullscreen state and that all interactions are strictly confined to the standalone window container.
  1. Smart Environment Awareness & Automated Fullscreen
    Mechanism: The extension leverages the window.matchMedia interface to monitor display modes (such as standalone or minimal-ui) in real-time.
    Technical Details: Once an app container environment is detected, the Content Script triggers an asynchronous message to the Background Script. The Background Script then invokes the native Firefox browser.windows.update API to atomically transition the window state to fullscreen.
    Optimization: This process includes a "Success-and-Dispose" logic—once fullscreen is locked, associated listeners are automatically purged from memory.
  2. JIT (Just-In-Time) Interception for Link "Escape"
    Mechanism: To solve the issue of links "escaping" via target="_blank", we utilize a JIT interception strategy, replacing resource-heavy DOM polling.
    Technical Details: A global click listener is mounted on the document during the Capture Phase. Within microseconds of a user interaction, the script traverses the DOM path.
    Logical Loop: If a target link is identified, the script strips the target attribute and evaluates the global base tag status just-in-time. Any new-window behavior is redirected to the current window, ensuring compatibility with modern SPA frameworks.
  3. Cross-Sandbox API Virtualization (window.open Interception)
    Mechanism: For script-triggered window.open calls, the extension utilizes advanced features unique to the Firefox Gecko engine.
    Technical Details: We have deprecated traditional DOM injection in favor of the exportFunction and wrappedJSObject interfaces to export safe interception logic from the sandbox.
    Outcome: This enables the extension to hijack window.open calls at native speeds without triggering CSP violation errors.
  4. Performance & Privacy-First Architecture
    Efficiency: By eliminating MutationObserver polling, the click-path traversal maintains ultra-low complexity (O(log N)). Execution time is typically under 0.1ms on standard hardware.
    Local Processing: All logic is processed locally. The extension does not request network permissions and strictly follows a Zero Data Collection policy.

Recommendation:
For an even better experience, pair this extension with Gesturefy (or other mouse gesture add-ons). Using mouse gestures in a fullscreen immersive environment allows for seamless navigation (Back, Forward, Close) that mimics the fluidity of professional desktop software.

About Development:
This extension was co-developed through a collaboration between myself and Gemini, combining human creative vision with AI-driven architectural optimization.
评分 0(1 位用户)
登录以评价此扩展
目前尚无评分

已保存星级评分

5
0
4
0
3
0
2
0
1
0
尚无评价
权限与数据

必要权限:

  • 获取浏览器标签页
  • 访问您在所有网站的数据

收集的数据:

  • 开发者称此扩展无需收集数据。
详细了解
更多信息
附加组件链接
  • Copy add-on ID
版本
3.1.0
大小
162.03 KB
上次更新
3 个月前 (2026年3月1日)
相关分类
  • 外观
  • 照片、音乐和视频
  • 标签页
许可证
Mozilla 公共许可证 2.0
版本历史
  • 查看所有版本
添加到收藏集
举报此附加组件
转至 Mozilla 主页

附加组件

  • 关于
  • Firefox 附加组件博客
  • 扩展工坊
  • 开发者中心
  • 开发者政策
  • 社区博客
  • 论坛
  • 报告缺陷
  • 评价指南

浏览器

  • Desktop
  • Mobile
  • Enterprise

产品

  • Browsers
  • VPN
  • Relay
  • Monitor
  • Pocket
  • Bluesky (@firefox.com)
  • Instagram (Firefox)
  • YouTube (firefoxchannel)
  • 隐私
  • Cookie
  • 法律

除非另有注明,否则本网站上的内容可按知识共享 署名-相同方式共享 3.0 或更新版本使用。