RESOLVED FIXED 237912
REGRESSION(r288307): instanceof value wrong in MutationObserver callback for Safari extensions
https://bugs.webkit.org/show_bug.cgi?id=237912
Summary REGRESSION(r288307): instanceof value wrong in MutationObserver callback for ...
Jeff Johnson
Reported 2022-03-15 11:42:12 PDT
Created attachment 454735 [details] Sample Xcode project This bug occurs with Safari Technology Release 141 (Safari 15.4, WebKit 16614.1.3.7) on macOS 11.6.5. The bug does not occur with Safari 15.3 or Safari 15.4 (released yesterday), only with Safari Technology Preview. The bug is that JavaScript instanceof is returning false when it should return true in the callback of MutationObserver for Safari extensions, both Safari web extensions and Safari app extensions. This bug does not seem to affect scripts in the web pages, only extension scripts. Attached is a sample Safari web extension Xcode project that demonstrates the bug. Just enable the extension, run it on any web site, such as cnn.com, and look at the console log. For HTML <div> elements, it should log true true for instanceof HTMLElement and instanceof HTMLDivElement, but it logs false false in Safari Technology Preview 141. This bug is a massive problem for me, a showstopper for several of my Safari extensions in the App Store. It totally breaks essential functionality in my extensions.
Attachments
Sample Xcode project (324.10 KB, application/zip)
2022-03-15 11:42 PDT, Jeff Johnson
no flags
Patch (9.46 KB, patch)
2022-03-22 09:01 PDT, Alexey Shvayka
no flags
Jeff Johnson
Comment 1 2022-03-15 11:44:40 PDT
Note that instanceof works correctly in the setTimeout function. It's only wrong in the MutationObserver callback.
Jeff Johnson
Comment 2 2022-03-15 12:10:15 PDT
I can also reproduce with Safari Technology Preview 141 on macOS 12.3 on Apple Silicon. Safari 15.4 (17613.1.17.1.6) is not affected.
Jon Davis
Comment 3 2022-03-15 13:39:52 PDT
Thank you for the bug report. I’ve cc’d some engineers to investigate.
Radar WebKit Bug Importer
Comment 4 2022-03-15 15:12:14 PDT
Alexey Shvayka
Comment 5 2022-03-22 09:01:29 PDT
EWS
Comment 6 2022-03-22 13:25:31 PDT
Committed r291694 (248736@main): <https://commits.webkit.org/248736@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455377 [details].
Note You need to log in before you can comment on or make changes to this bug.