Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试向窗口添加事件侦听器,但我不确定如何获取窗口。
我目前有这个。
let onUnhandledRejection = (e) => { /* TODO: write this */ } WindowRe.addEventListener( "unhandledrejection", onUnhandledRejection, WINDOW_GOES_HERE: Dom.window );
当前窗口对象可用作Webapi.Dom.window
Webapi.Dom.window
let onUnhandledRejection = (e) => { /* TODO: write this */ } Webapi.Dom.Window.addEventListener( "unhandledrejection", onUnhandledRejection, Webapi.Dom.window );
您也不应该使用WindowRe它,因为它是私有 API。
WindowRe