New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@iframe-resizer/parent

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iframe-resizer/parent - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

2

index.cjs.js
/*!
* @preserve
*
* @module iframe-resizer/parent 5.1.0 (cjs) - 2024-06-18
* @module iframe-resizer/parent 5.1.1 (cjs) - 2024-06-19
*

@@ -6,0 +6,0 @@ * @license GPL-3.0 for non-commercial use only.

/*!
* @preserve
*
* @module iframe-resizer/parent 5.1.0 (esm) - 2024-06-18
* @module iframe-resizer/parent 5.1.1 (esm) - 2024-06-19
*

@@ -6,0 +6,0 @@ * @license GPL-3.0 for non-commercial use only.

/*!
* @preserve
*
* @module iframe-resizer/parent 5.1.0 (umd) - 2024-06-18
* @module iframe-resizer/parent 5.1.1 (umd) - 2024-06-19
*

@@ -20,2 +20,2 @@ * @license GPL-3.0 for non-commercial use only.

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";const e="[iframe-resizer]";const t=t=>`${e}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(t)}]`,i=(e,i,...n)=>window?.console[e](t(i),...n),n=(e,...t)=>i("warn",e,...t),o=(t,i)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((t=>(...i)=>[`${e}[${t}]`,...i].join(" "))(t))(i)),r="5.1.0",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),d=(e,t,i)=>e.removeEventListener(t,i,!1),u=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},f=u((()=>{const e=document.createElement("script");e.async=!0,e.src="//cdn.jsdelivr.net/gh/iframe-resizer/modal/iframe-resizer.modal.js",document.head.append(e)})),p=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},m=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),h=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>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.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."],y=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],g=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),w=e=>m(h[e]),b=e=>{const t=e[m("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=p(m(e));return i in g&&(t=g[i]),t}(i[0]);return 0===n||(e=>e[2]===p(e[0]+e[1]))(i)||(n=-2),n},z={},v=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof z[e.id].onInit&&(o(e.id,"\nDeprecated Option\n\nThe onInit() function is deprecated and has been replaced with onReady(). It will be removed in a future version of iFrame Resizer.\n "),z[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),j={position:null,version:r};function T(e){function t(){E(H),x(),C("onResized",H)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}function u(e){return L.slice(L.indexOf(":")+7+e)}const f=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){W(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},p=(e,t)=>()=>{const i=t=>()=>{z[r]?e(t,r):o()};function n(e,t){t(window,"scroll",i("scroll")),t(window,"resize",i("resize window"))}function o(){n(0,d),a.disconnect(),s.disconnect()}const r=P,a=new ResizeObserver(i("page observed")),s=new ResizeObserver(i("iframe observed"));n(0,c),a.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),s.observe(z[r].iframe,{attributes:!0,childList:!1,subtree:!1}),z[r]&&(z[r][`stop${t}`]=o)},m=e=>()=>{e in z[P]&&(z[P][e](),delete z[P][e])},h=f("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=H.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),y=f("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),g=p(h,"PageInfo"),w=p(y,"ParentInfo"),b=m("stopPageInfo"),v=m("stopParentInfo");function T(e){const t=e.getBoundingClientRect();return I(),{x:Number(t.left)+Number(j.position.x),y:Number(t.top)+Number(j.position.y)}}function $(e){const t=e?T(H.iframe):{x:0,y:0};let i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(H,t);window.top===window.self?(j.position=i,F(P)):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](i.x,i.y):n(P,"Unable to scroll to requested position, window.parentIFrame not found")}function F(e){const{x:t,y:i}=j.position,n=z[e]?.iframe;!1!==C("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?x():M()}function A(e){let t={};if(0===H.width&&0===H.height){const e=u(9).split(":");t={x:e[1],y:e[0]}}else t={x:H.width,y:H.height};C(e,{iframe:H.iframe,screenX:Number(t.x),screenY:Number(t.y),type:H.type})}const C=(e,t)=>k(P,e,t);let L=e.data,H={},P=null;"[iFrameResizerChild]Ready"!==L?a===`${L}`.slice(0,s)&&L.slice(s).split(":")[0]in z&&(H=function(){const e=L.slice(s).split(":"),t=e[1]?Number(e[1]):0,n=z[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:t+i(o)+l(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),P=H.id,P?(function(e){if(!z[e])throw new Error(`${H.type} No settings for ${e}. Message was: ${L}`)}(P),H.type in{true:1,false:1,undefined:1}||(z[P].loaded=!0,function(){let e=!0;return null===H.iframe&&(n(P,`The iframe (${H.id}) was not found.`),e=!1),e}()&&function(){const{origin:t,sameDomain:i}=e;if(i)return!0;let n=z[P]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(;e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=z[P]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${H.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(z[P]?.firstRun&&z[P]&&(z[P].firstRun=!1),H.type){case"close":R(H.iframe);break;case"message":i=u(6),C("onMessage",{iframe:H.iframe,message:JSON.parse(i)});break;case"mouseenter":A("onMouseEnter");break;case"mouseleave":A("onMouseLeave");break;case"autoResize":z[P].autoResize=JSON.parse(u(9));break;case"scrollBy":!function(){const e=H.width,t=H.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":$(!1);break;case"scrollToOffset":$(!0);break;case"pageInfo":h("start",P),g();break;case"parentInfo":y("start",P),w();break;case"pageInfoStop":b();break;case"parentInfoStop":v();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=T(n);j.position={x:e.x,y:e.y},F(P)}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(u(9));break;case"title":!function(e,t){z[t]?.syncTitle&&(z[t].iframe.title=e)}(H.msg,P);break;case"reset":S(H);break;case"init":t(),function(e){try{z[e].sameDomain=!!z[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){z[e].sameDomain=!1}}(P),(e=H.msg)!==r&&(void 0!==e||o(P,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),O=!0,C("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void n(`Unsupported message received (${H.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===H.width||0===H.height)return;if(document.hidden)return;t()}var e,i}())):n("iframeResizer received messageData without id, message was: ",L)):Object.keys(z).forEach((e=>{z[e].mode>=0&&W("iFrame requested init",N(e),e)}))}function k(e,t,i){let n=null,o=null;if(z[e]){if(n=z[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);o=n(i)}return o}function $(e){const t=e.id;delete z[t]}function R(e){const t=e.id;if(!1!==k(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){n(e)}k(t,"onClosed",t),$(e)}}function I(e){null===j.position&&(j.position={x:window.scrollX,y:window.scrollY})}function M(){j.position=null}function x(e){null!==j.position&&(window.scrollTo(j.position.x,j.position.y),M())}function S(e){I(e.id),E(e),W("reset","reset",e.id)}function E(e){const t=e.id;function i(t){const i=`${e[t]}px`;e.iframe.style[t]=i}z[t].sizeHeight&&i("height"),z[t].sizeWidth&&i("width")}function W(e,t,i,r){z[i]&&(z[i]?.postMessageTarget?function(){const{postMessageTarget:e,targetOrigin:n}=z[i];if(z[i].sameDomain)try{return void z[i].iframe.contentWindow.iframeChildListener(a+t)}catch(e){}e.postMessage(a+t,n)}():n(i,`[${e}] IFrame(${i}) not found`),r&&z[i]?.warningTimeout&&(z[i].msgTimeout=setTimeout((function(){void 0!==z[i]&&(z[i].loaded||z[i].loadErrorShown||(z[i].loadErrorShown=!0,o(i,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${z[i].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)))}),z[i].warningTimeout)))}function N(e){const t=z[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,j.version,t.mode].join(":")}let F=0,O=!1,A=!1;const C=e=>t=>{function a(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&o(d,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function s(e){const{title:t}=document.getElementById(e);return""===t}const d=function(i){if(i&&"string"!=typeof i)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(t.id=i=function(){let t=e?.id||v.id+F++;return null!==document.getElementById(t)&&(t+=F++),t}(),(e||{}).log),i}(t.id);return d in z&&"iFrameResizer"in t?n(d,"Ignored iFrame, already setup."):(function(e){var i,n;z[d]={iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...v,...a(e),mode:b(e),syncTitle:s(d)},function(){if("horizontal"===z[d].direction)return z[d].sizeWidth=!0,void(z[d].sizeHeight=!1);if("none"===z[d].direction)return z[d].sizeWidth=!1,z[d].sizeHeight=!1,void(z[d].autoResize=!1);if("vertical"!==z[d].direction)throw new TypeError(d,`Direction value of "${z[d].direction}" is not valid`)}(),i=e?.offset,i&&("vertical"===z[d].direction?z[d].offsetHeight=i:z[d].offsetWidth=i),null===z[d].postMessageTarget&&(z[d].postMessageTarget=t.contentWindow),z[d].targetOrigin=!0===z[d].checkOrigin?""===(n=z[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(e),function(){const{mode:e}=z[d];e<0&&o("Parent",`${w(e+2)}${w(2)}`),A||e<0||(A=!0,((e,...t)=>{i("info",e,...t)})(`v${r} (${(e=>m(y[e]))(e)})`),e<1&&o("Parent",w(3)))}(),H(),function(){switch(t.style.overflow=!1===z[d]?.scrolling?"hidden":"auto",z[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=z[d]?z[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=z[d];"number"!=typeof e&&"0"!==e||(z[d].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t;-1===z[i].mode&&f(),-2!==z[i].mode&&(c(t,"load",(function(){W("iFrame.onload",`${e}:${O}`,i,!0),function(){const e=z[d]?.firstRun,i=z[d]?.heightCalculationMethod in l;!e&&i&&S({iframe:t,height:0,width:0,type:"init"})}()})),!1===z[i].waitForLoad&&W("init",`${e}:${O}`,i,!0))}(N(d)),function(){if(z[d]){const e={close:R.bind(null,z[d].iframe),disconnect:$.bind(null,z[d].iframe),removeListeners(){o(d,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:W.bind(null,"Window resize","resize",d),moveToAnchor(e){W("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){W("Send Message",`message:${e=JSON.stringify(e)}`,d)}};z[d].iframe.iframeResizer=e,z[d].iframe.iFrameResizer=e}}()),t?.iFrameResizer};function L(){!1===document.hidden&&function(e,t){const i=e=>z[e]?.autoResize&&!z[e]?.firstRun;Object.keys(z).forEach((function(n){i(n)&&W(e,t,n)}))}("Tab Visible","resize")}const H=u((()=>{c(window,"message",T),c(document,"visibilitychange",L),window.iframeParentListener=e=>T({data:e,sameDomain:!0})})),P="[iframeResizer] ";const B=function(){function e(e){switch(!0){case!e:throw new TypeError(`${P}iframe is not defined`);case!e.tagName:throw new TypeError(`${P}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${P}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),i.push(e)}}let t,i;return function(n,o){if("undefined"==typeof window)return[];switch(t=C(n),i=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${P}Unexpected data type (${typeof o})`)}return Object.freeze(i)}}();return"undefined"!=typeof window&&(window.iFrameResize=function(...e){o("","Deprecated: iFrameResize(), please use iframeResize()"),B(...e)}),B}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";const e="[iframe-resizer]";const t=t=>`${e}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(t)}]`,i=(e,i,...n)=>window?.console[e](t(i),...n),n=(e,...t)=>i("warn",e,...t),o=(t,i)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((t=>(...i)=>[`${e}[${t}]`,...i].join(" "))(t))(i)),r="5.1.1",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),d=(e,t,i)=>e.removeEventListener(t,i,!1),u=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},f=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),p=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>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.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>."],m=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],h=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),y=e=>f(p[e]),g=e=>{const t=e[f("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=u(f(e));return i in h&&(t=h[i]),t}(i[0]);return 0===n||(e=>e[2]===u(e[0]+e[1]))(i)||(n=-2),n},w={},b=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof w[e.id].onInit&&(o(e.id,"\nDeprecated Option\n\nThe onInit() function is deprecated and has been replaced with onReady(). It will be removed in a future version of iFrame Resizer.\n "),w[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),v={position:null,version:r};function z(e){function t(){x(H),I(),C("onResized",H)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}function u(e){return L.slice(L.indexOf(":")+7+e)}const f=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){S(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},p=(e,t)=>()=>{const i=t=>()=>{w[r]?e(t,r):o()};function n(e,t){t(window,"scroll",i("scroll")),t(window,"resize",i("resize window"))}function o(){n(0,d),a.disconnect(),s.disconnect()}const r=P,a=new ResizeObserver(i("page observed")),s=new ResizeObserver(i("iframe observed"));n(0,c),a.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),s.observe(w[r].iframe,{attributes:!0,childList:!1,subtree:!1}),w[r]&&(w[r][`stop${t}`]=o)},m=e=>()=>{e in w[P]&&(w[P][e](),delete w[P][e])},h=f("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=H.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),y=f("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),g=p(h,"PageInfo"),b=p(y,"ParentInfo"),z=m("stopPageInfo"),T=m("stopParentInfo");function W(e){const t=e.getBoundingClientRect();return $(),{x:Number(t.left)+Number(v.position.x),y:Number(t.top)+Number(v.position.y)}}function F(e){const t=e?W(H.iframe):{x:0,y:0};let i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(H,t);window.top===window.self?(v.position=i,O(P)):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](i.x,i.y):n(P,"Unable to scroll to requested position, window.parentIFrame not found")}function O(e){const{x:t,y:i}=v.position,n=w[e]?.iframe;!1!==C("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?I():R()}function A(e){let t={};if(0===H.width&&0===H.height){const e=u(9).split(":");t={x:e[1],y:e[0]}}else t={x:H.width,y:H.height};C(e,{iframe:H.iframe,screenX:Number(t.x),screenY:Number(t.y),type:H.type})}const C=(e,t)=>j(P,e,t);let L=e.data,H={},P=null;"[iFrameResizerChild]Ready"!==L?a===`${L}`.slice(0,s)&&L.slice(s).split(":")[0]in w&&(H=function(){const e=L.slice(s).split(":"),t=e[1]?Number(e[1]):0,n=w[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:t+i(o)+l(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),P=H.id,P?(function(e){if(!w[e])throw new Error(`${H.type} No settings for ${e}. Message was: ${L}`)}(P),H.type in{true:1,false:1,undefined:1}||(w[P].loaded=!0,function(){let e=!0;return null===H.iframe&&(n(P,`The iframe (${H.id}) was not found.`),e=!1),e}()&&function(){const{origin:t,sameDomain:i}=e;if(i)return!0;let n=w[P]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(;e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=w[P]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${H.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(w[P]?.firstRun&&w[P]&&(w[P].firstRun=!1),H.type){case"close":k(H.iframe);break;case"message":i=u(6),C("onMessage",{iframe:H.iframe,message:JSON.parse(i)});break;case"mouseenter":A("onMouseEnter");break;case"mouseleave":A("onMouseLeave");break;case"autoResize":w[P].autoResize=JSON.parse(u(9));break;case"scrollBy":!function(){const e=H.width,t=H.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":F(!1);break;case"scrollToOffset":F(!0);break;case"pageInfo":h("start",P),g();break;case"parentInfo":y("start",P),b();break;case"pageInfoStop":z();break;case"parentInfoStop":T();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=W(n);v.position={x:e.x,y:e.y},O(P)}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(u(9));break;case"title":!function(e,t){w[t]?.syncTitle&&(w[t].iframe.title=e)}(H.msg,P);break;case"reset":M(H);break;case"init":t(),function(e){try{w[e].sameDomain=!!w[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){w[e].sameDomain=!1}}(P),(e=H.msg)!==r&&(void 0!==e||o(P,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),N=!0,C("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void n(`Unsupported message received (${H.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===H.width||0===H.height)return;if(document.hidden)return;t()}var e,i}())):n("iframeResizer received messageData without id, message was: ",L)):Object.keys(w).forEach((e=>{w[e].mode>=0&&S("iFrame requested init",E(e),e)}))}function j(e,t,i){let n=null,o=null;if(w[e]){if(n=w[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);o=n(i)}return o}function T(e){const t=e.id;delete w[t]}function k(e){const t=e.id;if(!1!==j(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){n(e)}j(t,"onClosed",t),T(e)}}function $(e){null===v.position&&(v.position={x:window.scrollX,y:window.scrollY})}function R(){v.position=null}function I(e){null!==v.position&&(window.scrollTo(v.position.x,v.position.y),R())}function M(e){$(e.id),x(e),S("reset","reset",e.id)}function x(e){const t=e.id;function i(t){const i=`${e[t]}px`;e.iframe.style[t]=i}w[t].sizeHeight&&i("height"),w[t].sizeWidth&&i("width")}function S(e,t,i,r){w[i]&&(w[i]?.postMessageTarget?function(){const{postMessageTarget:e,targetOrigin:n}=w[i];if(w[i].sameDomain)try{return void w[i].iframe.contentWindow.iframeChildListener(a+t)}catch(e){}e.postMessage(a+t,n)}():n(i,`[${e}] IFrame(${i}) not found`),r&&w[i]?.warningTimeout&&(w[i].msgTimeout=setTimeout((function(){void 0!==w[i]&&(w[i].loaded||w[i].loadErrorShown||(w[i].loadErrorShown=!0,o(i,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${w[i].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)))}),w[i].warningTimeout)))}function E(e){const t=w[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,v.version,t.mode].join(":")}let W=0,N=!1,F=!1;const O=e=>t=>{function a(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&o(d,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function s(e){const{title:t}=document.getElementById(e);return""===t}const d=function(i){if(i&&"string"!=typeof i)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(t.id=i=function(){let t=e?.id||b.id+W++;return null!==document.getElementById(t)&&(t+=W++),t}(),(e||{}).log),i}(t.id);return d in w&&"iFrameResizer"in t?n(d,"Ignored iFrame, already setup."):(function(e){var i,n;w[d]={iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...b,...a(e),mode:g(e),syncTitle:s(d)},function(){if("horizontal"===w[d].direction)return w[d].sizeWidth=!0,void(w[d].sizeHeight=!1);if("none"===w[d].direction)return w[d].sizeWidth=!1,w[d].sizeHeight=!1,void(w[d].autoResize=!1);if("vertical"!==w[d].direction)throw new TypeError(d,`Direction value of "${w[d].direction}" is not valid`)}(),i=e?.offset,i&&("vertical"===w[d].direction?w[d].offsetHeight=i:w[d].offsetWidth=i),null===w[d].postMessageTarget&&(w[d].postMessageTarget=t.contentWindow),w[d].targetOrigin=!0===w[d].checkOrigin?""===(n=w[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(e),function(){const{mode:e}=w[d];e<0&&o("Parent",`${y(e+2)}${y(2)}`),F||e<0||(F=!0,((e,...t)=>{i("info",e,...t)})(`v${r} (${(e=>f(m[e]))(e)})`),e<1&&o("Parent",y(3)))}(),C(),function(){switch(t.style.overflow=!1===w[d]?.scrolling?"hidden":"auto",w[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=w[d]?w[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=w[d];"number"!=typeof e&&"0"!==e||(w[d].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t;-1!==w[i].mode&&-2!==w[i].mode&&(c(t,"load",(function(){S("iFrame.onload",`${e}:${N}`,i,!0),function(){const e=w[d]?.firstRun,i=w[d]?.heightCalculationMethod in l;!e&&i&&M({iframe:t,height:0,width:0,type:"init"})}()})),!1===w[i].waitForLoad&&S("init",`${e}:${N}`,i,!0))}(E(d)),function(){if(w[d]){const e={close:k.bind(null,w[d].iframe),disconnect:T.bind(null,w[d].iframe),removeListeners(){o(d,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:S.bind(null,"Window resize","resize",d),moveToAnchor(e){S("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){S("Send Message",`message:${e=JSON.stringify(e)}`,d)}};w[d].iframe.iframeResizer=e,w[d].iframe.iFrameResizer=e}}()),t?.iFrameResizer};function A(){!1===document.hidden&&function(e,t){const i=e=>w[e]?.autoResize&&!w[e]?.firstRun;Object.keys(w).forEach((function(n){i(n)&&S(e,t,n)}))}("Tab Visible","resize")}const C=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{c(window,"message",z),c(document,"visibilitychange",A),window.iframeParentListener=e=>z({data:e,sameDomain:!0})})),L="[iframeResizer] ";const H=function(){function e(e){switch(!0){case!e:throw new TypeError(`${L}iframe is not defined`);case!e.tagName:throw new TypeError(`${L}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${L}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),i.push(e)}}let t,i;return function(n,o){if("undefined"==typeof window)return[];switch(t=O(n),i=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${L}Unexpected data type (${typeof o})`)}return Object.freeze(i)}}();return"undefined"!=typeof window&&(window.iFrameResize=function(...e){o("","Deprecated: iFrameResize(), please use iframeResize()"),H(...e)}),H}));
{
"name": "@iframe-resizer/parent",
"version": "5.1.0",
"version": "5.1.1",
"license": "GPL-3.0",

@@ -43,4 +43,4 @@ "homepage": "https://iframe-resizer.com",

"dependencies": {
"@iframe-resizer/core": "5.1.0"
"@iframe-resizer/core": "5.1.1"
}
}

@@ -25,2 +25,2 @@ [<img src="https://iframe-resizer.com/logo-full.svg" alt="" title="" style="margin-bottom: -20px">](https://iframe-resizer.com)

_iframe-resizer version 5.1.0 2024-06-18 - 08:28:20.374Z_
_iframe-resizer version 5.1.1 2024-06-19 - 12:34:39.866Z_
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc