Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flawed jQuery check causes script to not work #1099

Closed
gabrielgrant opened this issue Nov 8, 2022 · 1 comment
Closed

flawed jQuery check causes script to not work #1099

gabrielgrant opened this issue Nov 8, 2022 · 1 comment

Comments

@gabrielgrant
Copy link
Contributor

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:

image

To Reproduce
Steps to reproduce the behavior:

  1. Open dev console on a page that doesn't use jQuery
  2. check that jQuery isn't present: 'jQuery' in window
  3. set window.jQuery = undefined
  4. confirm 'jQuery' in window
  5. run the check: 'jQuery' in window && 'iFrameResize' in window.jQuery.prototype
  6. 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

@gabrielgrant
Copy link
Contributor Author

gabrielgrant commented Nov 8, 2022

how this manifests in my actual use of the script:

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant