diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..c35a00240
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,19 @@
+# EditorConfig helps developers define and maintain consistent
+# coding styles between different editors and IDEs
+# editorconfig.org
+
+root = true
+
+[*]
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+indent_size = 2
+
+[*.hbs]
+insert_final_newline = false
+
+[*.{diff,md}]
+trim_trailing_whitespace = false
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 000000000..02eedc8f0
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,6 @@
+dist
+js
+**/*.d.js
+coverage
+example/react/src/message-data.jsx
+packages/common/mode.js
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index d110dfc5f..000000000
--- a/.eslintrc
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "extends": ["auto"],
- "plugins": ["ie11"],
- "env": {
- "amd": true,
- "browser": true,
- "jasmine": true
- },
- "globals": {
- "location": true
- },
- "parserOptions": { "ecmaVersion": 2015 },
- "rules": {
- "func-names": 0,
- "global-require": 0,
- "no-param-reassign": 0,
- "no-plusplus": 0,
- "no-use-before-define": 0,
- "no-shadow": 0,
- "no-var": 0,
- "object-shorthand": 0,
- "one-var": 0,
- "prefer-arrow-callback": 0,
- "prefer-destructuring": 0,
- "prefer-object-spread": 0,
- "prefer-rest-params": 0,
- "prefer-template": 0,
- "vars-on-top": 0,
- "yoda": 0,
- "ie11/no-collection-args": ["error"],
- "ie11/no-for-in-const": ["error"],
- "ie11/no-loop-func": ["warn"],
- "ie11/no-weak-collections": ["error"],
- "import/no-amd": 0,
- "lodash/prefer-noop": 0,
- "lodash-fp/prefer-constant": 0,
- "pii/no-email": 0,
- "switch-case/no-case-curly": 0,
- "unicorn/consistent-function-scoping": 0,
- "unicorn/filename-case": 0,
- "unicorn/no-array-callback-reference": 0,
- "unicorn/no-array-method-this-argument": 0,
- "unicorn/no-this-assignment": 0,
- "unicorn/prefer-date-now": 0,
- "unicorn/prefer-dom-node-append": 0,
- "unicorn/prefer-dom-node-remove": 0,
- "unicorn/prefer-module": 0,
- "unicorn/prefer-node-append": 0,
- "unicorn/prefer-node-protocol": 0,
- "unicorn/prefer-node-remove": 0,
- "unicorn/prefer-query-selector": 0,
- "unicorn/prefer-string-slice": 0,
- "unicorn/prefer-top-level-await": 0,
- "unicorn/prefer-number-properties": 0,
- "unicorn/prevent-abbreviations": 0,
- "unicorn/switch-case-braces": 0
- }
-}
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 000000000..54201adab
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,100 @@
+{
+ "extends": ["auto"],
+ "ignorePatterns": ["js/*", "dist/*", "*.d.ts"],
+ "env": {
+ "amd": true,
+ "browser": true,
+ "jasmine": true,
+ "jest": true,
+ "jquery": true,
+ "commonjs": true,
+ "es2020": true
+ },
+ "globals": {
+ "location": true,
+ "iframeResize": true,
+ "parentIFrame": true
+ },
+ "parserOptions": { "ecmaVersion": 2021 },
+ "rules": {
+ "comma-dangle": [1, "always-multiline"],
+ "const-case/uppercase": 0,
+ "func-names": 0,
+ "global-require": 0,
+ "no-param-reassign": 0,
+ "no-plusplus": 0,
+ "no-return-assign": [2, "except-parens"],
+ "no-use-before-define": 0,
+ "no-shadow": 0,
+ "prefer-rest-params": 0,
+ "import/no-amd": 0,
+ "import/no-unresolved": 0,
+ "lodash/prefer-noop": 0,
+ "pii/no-email": 0,
+ "react/prop-types": 0,
+ "sonarjs/no-nested-template-literals": 0,
+ "switch-case/no-case-curly": 0,
+ "unicorn/consistent-function-scoping": 0,
+ "unicorn/no-array-callback-reference": 0,
+ "unicorn/no-array-reduce": 0,
+ "unicorn/no-this-assignment": 0,
+ "unicorn/prefer-module": 0,
+ "unicorn/prefer-query-selector": 0,
+ "unicorn/prevent-abbreviations": 0,
+ "xss/no-mixed-html": 0
+ },
+ "overrides": [
+ {
+ "files": ["*.html"],
+ "rules": {
+ "no-alert": 0,
+ "no-console": 0,
+ "no-restricted-globals": 0,
+ "no-undef": 0,
+ "no-unused-vars": 0,
+ "no-unsanitized/property": 0,
+ "prettier/prettier": 0,
+ "xss/no-location-href-assign": 0
+ }
+ },
+ {
+ "files": ["spec/**"],
+ "globals": {
+ "jasmine": true,
+ "describe": true,
+ "it": true,
+ "expect": true,
+ "beforeEach": true,
+ "afterEach": true,
+ "spyOn": true,
+ "spyOnProperty": true,
+ "spyOnAllFunctions": true,
+ "spyOnIFramePostMessage": true,
+ "getTarget": true,
+ "LOG": true,
+ "tearDown": true,
+ "loadIFrame": true,
+ "mockMsgFromIFrame": true,
+ "loadFixtures": true,
+ "spyPostMsg": true,
+ "msgObject": true,
+ "msgCalled": true,
+ "win": true
+ },
+ "rules": {
+ "no-console": 0,
+ "prefer-destructuring": 0,
+ "prefer-template": 0,
+ "yoda": 0,
+ "jasmine/no-disabled-tests": 0,
+ "jest/expect-expect": 0,
+ "jest/no-done-callback": 0,
+ "jest/no-jasmine-globals": 0,
+ "jest/no-test-prefixes": 0,
+ "jest/prefer-to-be": 0,
+ "no-secrets/no-secrets": 0,
+ "sonarjs/no-duplicate-string": 0
+ }
+ }
+ ]
+}
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml.disable
similarity index 88%
rename from .github/workflows/codeql.yml
rename to .github/workflows/codeql.yml.disable
index 04c5e7da2..6496c3fd2 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml.disable
@@ -5,6 +5,10 @@ on:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
+ paths-ignore:
+ - '**/*.md'
+ - '**/*.txt'
+ - 'js/**'
schedule:
- cron: "39 23 * * 5"
@@ -16,7 +20,7 @@ jobs:
actions: read
contents: read
security-events: write
-
+
strategy:
fail-fast: false
matrix:
@@ -24,7 +28,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml
index 3a541734c..346ea8bd2 100644
--- a/.github/workflows/eslint.yml
+++ b/.github/workflows/eslint.yml
@@ -25,26 +25,19 @@ jobs:
permissions:
contents: read
security-events: write
- actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Install ESLint
- run: |
- npm install eslint@8
- npm install @microsoft/eslint-formatter-sarif@2.1.7
+ run: npm install @microsoft/eslint-formatter-sarif@3
- name: Run ESLint
- run: npx eslint .
- --config .eslintrc.js
- --ext .js,.jsx,.ts,.tsx
- --format @microsoft/eslint-formatter-sarif
- --output-file eslint-results.sarif
+ run: npm run eslint:sarif
continue-on-error: true
- name: Upload analysis results to GitHub
- uses: github/codeql-action/upload-sarif@v2
+ uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: eslint-results.sarif
wait-for-processing: true
diff --git a/.gitignore b/.gitignore
index 526126a64..8f1a5bf22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,13 @@
.DS_Store
.coveralls.yml
node_modules
-bin
example/test.html
test/*.off
npm-debug.log
bower_components
coverage*
.idea
+js/*.js.map
+js/*.map.js
+dist
+test-js
diff --git a/.npmignore b/.npmignore
index cda194ae4..31d0e7324 100644
--- a/.npmignore
+++ b/.npmignore
@@ -7,16 +7,17 @@
.travis.yml
.github
*.md
-js/*.min.js
-js/*.map
+*.map
node_modules
bin
+dist
docs
example
img
test
+test-js
spec
-src
+packages
npm-debug.log
bower_components
bower.json
@@ -25,3 +26,4 @@ karma.conf.js
test-main.js
package-lock.json
coverage*
+FUNDING.md
diff --git a/.prettierrc b/.prettierrc
index db185d645..b17910eda 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,10 +1,10 @@
{
- "printWidth": 80,
- "tabWidth": 2,
- "useTabs": false,
- "semi": false,
- "singleQuote": true,
- "trailingComma": "none",
- "bracketSpacing": true,
- "jsxBracketSameLine": false
- }
+ "printWidth": 80,
+ "tabWidth": 2,
+ "useTabs": false,
+ "semi": false,
+ "singleQuote": true,
+ "trailingComma": "all",
+ "bracketSpacing": true,
+ "jsxBracketSameLine": false
+}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 93ada0136..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: node_js
-node_js:
- - "11.0"
-before_script:
- - npm install -g grunt-cli
-sudo: false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 990904f1f..b0cdf2212 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
# Version History
+- v4.3.10 [#1229](https://github.com/davidjbradshaw/iframe-resizer/pull/1229) Fix close release destroyObserver [[Steve Hong](https://github.com/aniude)]
- v4.3.9 Reduce package size
@@ -58,7 +59,7 @@
- v3.6.3 [#635](https://github.com/davidjbradshaw/iframe-resizer/pull/635) Fix issue with undefined ID [[Henry Schein](https://github.com/ddxdental)]. [#582](https://github.com/davidjbradshaw/iframe-resizer/pull/582) Add `omit` option to `scrolling` config [[Matt Ryan](https://github.com/mryand)]
-- v3.6.2 [#596](https://github.com/davidjbradshaw/iframe-resizer/pull/596) Add Passive Event Listener for Performance [[Henrik Vendelbo](https://github.com/thepian)]. [#613](https://github.com/davidjbradshaw/iframe-resizer/pull/613) Check if the iFrameResize function is attached to the prototype of jQuery [[Paul Antal](https://github.com/paul-antal)]. [#620](https://github.com/davidjbradshaw/iframe-resizer/pull/620) Fixed an issue where host page fires init before iframe receiver setup [[Mark Zhou](https://github.com/mrmarktyy)]. [#620](https://github.com/davidjbradshaw/iframe-resizer/pull/620) Add `removeListeners` method to better support React [[Khang Nguyen](https://github.com/khangiskhan)]
+- v3.6.2 [#596](https://github.com/davidjbradshaw/iframe-resizer/pull/596) Add Passive Event Listener for Performance [[Henrik Vendelbo](https://github.com/thepian)]. [#613](https://github.com/davidjbradshaw/iframe-resizer/pull/613) Check if the function is attached to the prototype of jQuery [[Paul Antal](https://github.com/paul-antal)]. [#620](https://github.com/davidjbradshaw/iframe-resizer/pull/620) Fixed an issue where host page fires init before iframe receiver setup [[Mark Zhou](https://github.com/mrmarktyy)]. [#620](https://github.com/davidjbradshaw/iframe-resizer/pull/620) Add `removeListeners` method to better support React [[Khang Nguyen](https://github.com/khangiskhan)]
- v3.6.1 [#576](https://github.com/davidjbradshaw/iframe-resizer/pull/576) Fix race condition caused by react-iframe-resizer removing the domNode and calling `close()`
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3c160cf7f..37f3c8720 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -21,7 +21,7 @@ Good bug reports are extremely helpful, so thanks!
Guidelines for bug reports:
-0. **Lint your code** — Use [jshint](http://jshint.com/)
+0. **Lint your code** — Using `npm run eslint:fix`
to ensure your problem isn't caused by a simple error in your own code.
1. **Use the GitHub issue search** — check if the issue has already been
diff --git a/LICENSE b/LICENSE
index 06fd9040c..8617ba54e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,21 +1,191 @@
-The MIT License (MIT)
-
-Copyright (c) 2013-2023 David J. Bradshaw
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+Iframe Resizer Version 5
+
+This JavaScript library is Copyright © 2013-2024 David J. Bradshaw, and is distobuted for non-comercial usage under the GPL V3. Comerercial license available upon request.
+
+For more infomation on comercial licensing contact dave@bradshaw.net
+
+--
+
+GNU GENERAL PUBLIC LICENSE
+Version 3, 29 June 2007
+
+Copyright © 2007 Free Software Foundation, Inc.
+
Height Calculation Method -
+ a + +This option should be used sparingly, as the alternate methods can be @@ -99,7 +106,7 @@
Test in page anchor -This element will animate to a width of 800px using CSS keyframes.
++ This iframe contains a page element animated via CSS to change the height of the page. +
+ ++ This is an absolute positioned element that will animate to + a height of 800px using CSS keyframes. +
++ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim + veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. Duis aute irure dolor in reprehenderit in voluptate + velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint + occaecat cupidatat non proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
++ But I must explain to you how all this mistaken idea of denouncing + pleasure and praising pain was born and I will give you a complete + account of the system, and expound the actual teachings of the great + explorer of the truth, the master-builder of human happiness. No one + rejects, dislikes, or avoids pleasure itself, because it is pleasure, + but because those who do not know how to pursue pleasure rationally + encounter consequences that are extremely painful. Nor again is there + anyone who loves or pursues or desires to obtain pain of itself, because + it is pain, but because occasionally circumstances occur in which toil + and pain can procure him some great pleasure. To take a trivial example, + which of us ever undertakes laborious physical exercise, except to + obtain some advantage from it? But who has any right to find fault with + a man who chooses to enjoy a pleasure that has no annoying consequences, + or one who avoids a pain that produces no resultant pleasure? +
++ On the other hand, we denounce with righteous indignation and dislike + men who are so beguiled and demoralized by the charms of pleasure of the + moment, so blinded by desire, that they cannot foresee the pain and + trouble that are bound to ensue; and equal blame belongs to those who + fail in their duty through weakness of will, which is the same as saying + through shrinking from toil and pain. These cases are perfectly simple + and easy to distinguish. In a free hour, when our power of choice is + untrammelled and when nothing prevents our being able to do what we like + best, every pleasure is to be welcomed and every pain avoided. But in + certain circumstances and owing to the claims of duty or the obligations + of business it will frequently occur that pleasures have to be + repudiated and annoyances accepted. The wise man therefore always holds + in these matters to this principle of selection: he rejects pleasures to + secure other greater pleasures, or else he endures pains to avoid worse + pains. +
++ Mouse over the code example below. +
+ ++ Resize window or click one of the links in the nested iFrame to watch it + resize. +
++ iFrame + + Back to page 1 + + Bottom + + Scroll to iFrame + + Jump to iFrame anchor + Jump to parent anchor +
++ This page has an absolute position element that take it out side the + normal document body, which is marked with a red border on this page. This + prevents the normal height calculation, which is based on the body tag + from returning the correct height. +
++ a + + +
+ +Overflowing text
+ + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim + veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. Duis aute irure dolor in reprehenderit in voluptate + velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint + occaecat cupidatat non proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. + ++ Resize the textarea below. +
+ + + + + + + diff --git a/example/frame.content.html b/example/frame.content.html deleted file mode 100644 index 0f20f80c4..000000000 --- a/example/frame.content.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - -- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod - tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim - veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea - commodo consequat. Duis aute irure dolor in reprehenderit in voluptate - velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat - cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id - est laborum. -
-- But I must explain to you how all this mistaken idea of denouncing - pleasure and praising pain was born and I will give you a complete account - of the system, and expound the actual teachings of the great explorer of - the truth, the master-builder of human happiness. No one rejects, - dislikes, or avoids pleasure itself, because it is pleasure, but because - those who do not know how to pursue pleasure rationally encounter - consequences that are extremely painful. Nor again is there anyone who - loves or pursues or desires to obtain pain of itself, because it is pain, - but because occasionally circumstances occur in which toil and pain can - procure him some great pleasure. To take a trivial example, which of us - ever undertakes laborious physical exercise, except to obtain some - advantage from it? But who has any right to find fault with a man who - chooses to enjoy a pleasure that has no annoying consequences, or one who - avoids a pain that produces no resultant pleasure? -
-- On the other hand, we denounce with righteous indignation and dislike men - who are so beguiled and demoralized by the charms of pleasure of the - moment, so blinded by desire, that they cannot foresee the pain and - trouble that are bound to ensue; and equal blame belongs to those who fail - in their duty through weakness of will, which is the same as saying - through shrinking from toil and pain. These cases are perfectly simple and - easy to distinguish. In a free hour, when our power of choice is - untrammelled and when nothing prevents our being able to do what we like - best, every pleasure is to be welcomed and every pain avoided. But in - certain circumstances and owing to the claims of duty or the obligations - of business it will frequently occur that pleasures have to be repudiated - and annoyances accepted. The wise man therefore always holds in these - matters to this principle of selection: he rejects pleasures to secure - other greater pleasures, or else he endures pains to avoid worse pains. -
- - - - - - - - diff --git a/example/frame.hover.html b/example/frame.hover.html deleted file mode 100644 index 75f39cad4..000000000 --- a/example/frame.hover.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - -- Mouse over the code example below. -
-- In modern browsers size changes caused by CSS are detected via the ResizeObserver API, - however, if you have an element outside the standard document flow, or in really old browses you may need to detect this - yourself and ask iFrameResizer to update the page size. -
-- Uncomment the code below to see this working. -
- -- Resize window or click one of the links in the nested iFrame to watch it - resize. -
-- Resize the textarea below. -
- - - - - - - - - diff --git a/example/html/index.html b/example/html/index.html new file mode 100644 index 000000000..c26b1788c --- /dev/null +++ b/example/html/index.html @@ -0,0 +1,111 @@ + + + + ++ Resize window or click one of the links in the iFrame to watch it resize. + Or try with two iFrames. +
++ Resize window or click one of the links in the iFrame to watch it resize. + Or go back to a + single iFrame. +
++ Back to + horizontal iFrames. +
+- Resize window or click one of the links in the iFrame to watch it resize. - Or try with two iFrames. -
-This element will animate to a width of 800px using CSS keyframes.
++ This iframe contains a page element animated via CSS to change the height of the page. +
+ ++ This is an absolute positioned element that will animate to + a height of 800px using CSS keyframes. +
++ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim + veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. Duis aute irure dolor in reprehenderit in voluptate + velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint + occaecat cupidatat non proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. +
++ But I must explain to you how all this mistaken idea of denouncing + pleasure and praising pain was born and I will give you a complete + account of the system, and expound the actual teachings of the great + explorer of the truth, the master-builder of human happiness. No one + rejects, dislikes, or avoids pleasure itself, because it is pleasure, + but because those who do not know how to pursue pleasure rationally + encounter consequences that are extremely painful. Nor again is there + anyone who loves or pursues or desires to obtain pain of itself, because + it is pain, but because occasionally circumstances occur in which toil + and pain can procure him some great pleasure. To take a trivial example, + which of us ever undertakes laborious physical exercise, except to + obtain some advantage from it? But who has any right to find fault with + a man who chooses to enjoy a pleasure that has no annoying consequences, + or one who avoids a pain that produces no resultant pleasure? +
++ On the other hand, we denounce with righteous indignation and dislike + men who are so beguiled and demoralized by the charms of pleasure of the + moment, so blinded by desire, that they cannot foresee the pain and + trouble that are bound to ensue; and equal blame belongs to those who + fail in their duty through weakness of will, which is the same as saying + through shrinking from toil and pain. These cases are perfectly simple + and easy to distinguish. In a free hour, when our power of choice is + untrammelled and when nothing prevents our being able to do what we like + best, every pleasure is to be welcomed and every pain avoided. But in + certain circumstances and owing to the claims of duty or the obligations + of business it will frequently occur that pleasures have to be + repudiated and annoyances accepted. The wise man therefore always holds + in these matters to this principle of selection: he rejects pleasures to + secure other greater pleasures, or else he endures pains to avoid worse + pains. +
++ Mouse over the code example below. +
+ ++ Resize window or click one of the links in the nested iFrame to watch it + resize. +
++ iFrame + + Back to page 1 + + Bottom + + Scroll to iFrame + + Jump to iFrame anchor + Jump to parent anchor +
++ This page has an absolute position element that take it out side the + normal document body, which is marked with a red border on this page. This + prevents the normal height calculation, which is based on the body tag + from returning the correct height. +
++ a + + +
+ +Overflowing text
+ + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim + veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. Duis aute irure dolor in reprehenderit in voluptate + velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint + occaecat cupidatat non proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. + ++ Resize the textarea below. +
+ + + + + + + diff --git a/example/react/index.html b/example/react/index.html new file mode 100644 index 000000000..8d9900935 --- /dev/null +++ b/example/react/index.html @@ -0,0 +1,13 @@ + + + + + + +- Resize window or click one of the links in the iFrame to watch it resize. - Or go back to a - single iFrame. -
-pmyhtl-ylzpgly> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa oaawz://pmyhtl-ylzpgly.jvt/wypjpun>. pmyhtl-ylzpgly> vwapvuz av NWSc3>. pmyhtl-ylzpgly> pz ilpun bzlk bukly aol alytz vm aol NWS C3> spjluzl. Aopz spjluzl hssvdz fvb av bzl pmyhtl-ylzpgly> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl. pmyhtl-ylzpgly> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa oaawz://pmyhtl-ylzpgly.jvt/wypjpun>. pmyhtl-ylzpgly> vwapvuz av NWSc3>. pmyhtl-ylzpgly> pz ilpun bzlk bukly aol alytz vm aol NWS C3> spjluzl. Aopz spjluzl hssvdz fvb av bzl pmyhtl-ylzpgly> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl. pmyhtl-ylzpgly> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa oaawz://pmyhtl-ylzpgly.jvt/wypjpun>. pmyhtl-ylzpgly> vwapvuz av NWSc3>. pmyhtl-ylzpgly> pz ilpun bzlk bukly aol alytz vm aol NWS C3> spjluzl. Aopz spjluzl hssvdz fvb av bzl pmyhtl-ylzpgly> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.
","\n").replaceAll("
","\n").replaceAll(/<[/a-z]+>/gi,"")))(ie)(...e)),le=e=>re(e);function ce(){!function(){try{U="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");D=t[0],$=void 0===t[1]?$:Number(t[1]),C=void 0===t[2]?C:e(t[2]),L=void 0===t[3]?L:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],I=void 0===t[8]?I:t[8],S=t[9],O=t[10],Z=void 0===t[11]?Z:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),H=void 0===t[13]?H:t[13],G=void 0===t[14]?G:t[14],W=void 0===t[15]?W:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),M=void 0===t[18]?M:e(t[18]),t[19],X=t[20]||X,q=void 0===t[21]?q:Number(t[21])}(),function(){function e(){const e=window.iFrameResizer;_=e?.onMessage||_,ee=e?.onReady||ee,"number"==typeof e?.offset&&(M&&(b=e?.offset),C&&(w=e?.offset)),J=e?.targetOrigin||J,I=e?.heightCalculationMethod||I,G=e?.widthCalculationMethod||G}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===q)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),I=t(I,"height"),G=t(G,"width"))}(),function(){void 0===j&&(j=`${$}px`);se("margin",function(e,t){t.includes("-")&&(ae(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),se("background",S),se("padding",O),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),q<0?le(`${r(q+2)}${r(2)}`):X.codePointAt(0)>4||q<2&&le(r(3)),function(){if(!X||""===X||"false"===X)return void re(`
","\n").replaceAll("
","\n").replaceAll(/<[/a-z]+>/gi,"")))((e=>(...i)=>[`${a}[${e}]`,...i].join(" "))(e))(i)),d=e=>{if(!e)return"";let i=-559038744,t=1103547984;for(let n,o=0;o
","\n").replaceAll("
","\n").replaceAll(/<[/a-z]+>/gi,"")))((t=>(...i)=>[`${e}[${t}]`,...i].join(" "))(t))(i)),r="5.0.0-RC.3",a="[iFrameSizer]",s=a.length,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),c=(e,t,i,n)=>e.addEventListener(t,i,n||!1),u=(e,t,i)=>e.removeEventListener(t,i,!1),d=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o