flawed jQuery check causes script to not work
gabrielgrant opened this issue · comments
Describe the bug
PR #613 introduced a flawed check for jQuery:
('jQuery' in window) && ('iFrameResize' in window.jQuery.prototype)
see https://github.com/davidjbradshaw/iframe-resizer/pull/613/files
if jQuery
is set to undefined
this check will result in an error:
To Reproduce
Steps to reproduce the behavior:
- Open dev console on a page that doesn't use jQuery
- check that
jQuery
isn't present:'jQuery' in window
- set
window.jQuery = undefined
- confirm
'jQuery' in window
- run the check:
'jQuery' in window && 'iFrameResize' in window.jQuery.prototype
- See error
Expected behavior
The check should return false
Desktop:
- OS: Windows
- Browser chrome
- Version 106
Additional context
This seems to occur when including a mailchimp form in an iFrame
related: #1094