有什么方法可以检测(不使用user-agent和类似的).focus()支持focusOptions的方法,例如:preventScroll: true。
我在 Chrome 中使用它:
element.focus({
preventScroll: true
});
当然,这在 Chrome 和 Opera 之外的任何地方都行不通。但是我怎么能检测到呢?喜欢:
try { window.focus().preventScroll } catch {...}
有可能吗?