@iframe-resizer/jquery 5.3.0 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +1 -1
- package/index.esm.js +1 -1
- package/index.umd.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
package/index.cjs.js
CHANGED
package/index.esm.js
CHANGED
package/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/jquery 5.3.
|
|
4
|
+
* @module iframe-resizer/jquery 5.3.1 (umd) - 2024-09-12
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.3.0",i="[iFrameSizer]",t=i.length,n=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),o=(e,i,t,n)=>e.addEventListener(i,t,n||!1),r=(e,i,t)=>e.removeEventListener(i,t,!1),a="[iframe-resizer]";const s=e=>`${a}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(e)}]`,l=(e,i,...t)=>window?.console[e](s(i),...t),c=(e,...i)=>l("warn",e,...i),d=(e,i)=>console?.warn((e=>i=>window.chrome?e(i.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(i.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((e=>(...i)=>[`${a}[${e}]`,...i].join(" "))(e))(i)),u=e=>{if(!e)return"";let i=-559038744,t=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),i=Math.imul(i^n,2246822519),t=Math.imul(t^n,3266489917);return i^=Math.imul(i^t>>>15,1935289751),t^=Math.imul(t^i>>>15,3405138345),i^=t>>>16,t^=i>>>16,(2097152*(t>>>0)+(i>>>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,i)=>[e,Math.max(0,i-1)]))),y=e=>f(p[e]),g=e=>{const i=e[f("spjluzl")];if(!i)return-1;const t=i.split("-");let n=function(e=""){let i=-2;const t=u(f(e));return t in h&&(i=h[t]),i}(t[0]);return 0===n||(e=>e[2]===u(e[0]+e[1]))(t)||(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&&(d(e.id,"\n[31;1mDeprecated Option[m\n\nThe [1monInit()[m function is deprecated and has been replaced with [1monReady()[m. It will be removed in a future version of iFrame Resizer.\n "),w[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),v={position:null,version:e};function z(n){function a(){M(H),I(),O("onResized",H)}function s(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 A.slice(A.indexOf(":")+7+e)}const f=(e,i)=>(t,n)=>{const o={};var r,a;r=function(){x(`Send ${e} (${t})`,`${e}:${i()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},p=(e,i)=>()=>{let t=!1;const n=i=>()=>{w[d]?t&&t!==i||(e(i,d),t=i,requestAnimationFrame((()=>{t=!1}))):c()},a=n("scroll"),s=n("resize window");function l(e,i){i(window,"scroll",a),i(window,"resize",s)}function c(){l(0,r),u.disconnect(),f.disconnect()}const d=P,u=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));l(0,o),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(w[d].iframe,{attributes:!0,childList:!1,subtree:!1}),w[d]&&(w[d][`stop${i}`]=c)},m=e=>()=>{e in w[P]&&(w[P][e](),delete w[P][e])},h=f("pageInfo",(function(){const e=document.body.getBoundingClientRect(),i=H.iframe.getBoundingClientRect(),{scrollY:t,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(i.top-e.top,10),offsetLeft:parseInt(i.left-e.left,10),scrollTop:t,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),y=f("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:i,scrollHeight:t}=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:i,scrollHeight:t},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"),k=m("stopParentInfo");function F(e){const i=e.getBoundingClientRect();return R(),{x:Number(i.left)+Number(v.position.x),y:Number(i.top)+Number(v.position.y)}}function N(e){const i=e?F(H.iframe):{x:0,y:0};let t=((e,i)=>({x:e.width+i.x,y:e.height+i.y}))(H,i);window.top===window.self?(v.position=t,C(P)):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):c(P,"Unable to scroll to requested position, window.parentIFrame not found")}function C(e){const{x:i,y:t}=v.position,n=w[e]?.iframe;!1!==O("onScroll",{iframe:n,top:t,left:i,x:i,y:t})?I():$()}function E(e){let i={};if(0===H.width&&0===H.height){const e=u(9).split(":");i={x:e[1],y:e[0]}}else i={x:H.width,y:H.height};O(e,{iframe:H.iframe,screenX:Number(i.x),screenY:Number(i.y),type:H.type})}const O=(e,i)=>j(P,e,i);let A=n.data,H={},P=null;"[iFrameResizerChild]Ready"!==A?i===`${A}`.slice(0,t)&&A.slice(t).split(":")[0]in w&&(H=function(){const e=A.slice(t).split(":"),i=e[1]?Number(e[1]):0,n=w[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:i+s(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: ${A}`)}(P),H.type in{true:1,false:1,undefined:1}||(w[P].loaded=!0,function(){let e=!0;return null===H.iframe&&(c(P,`The iframe (${H.id}) was not found.`),e=!1),e}()&&function(){const{origin:e,sameDomain:i}=n;if(i)return!0;let t=w[P]?.checkOrigin;if(t&&"null"!=`${e}`&&!(t.constructor===Array?function(){let i=0,n=!1;for(;i<t.length;i++)if(t[i]===e){n=!0;break}return n}():function(){const i=w[P]?.remoteHost;return e===i}()))throw new Error(`Unexpected message received from: ${e} for ${H.iframe.id}. Message was: ${n.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":T(H.iframe);break;case"message":t=u(6),O("onMessage",{iframe:H.iframe,message:JSON.parse(t)});break;case"mouseenter":E("onMouseEnter");break;case"mouseleave":E("onMouseLeave");break;case"autoResize":w[P].autoResize=JSON.parse(u(9));break;case"scrollBy":!function(){const e=H.width,i=H.height;(window.parentIframe||window).scrollBy(e,i)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":h("start",P),g();break;case"parentInfo":y("start",P),b();break;case"pageInfoStop":z();break;case"parentInfoStop":k();break;case"inPageLink":!function(e){const i=e.split("#")[1]||"",t=decodeURIComponent(i);let n=document.getElementById(t)||document.getElementsByName(t)[0];n?function(){const e=F(n);v.position={x:e.x,y:e.y},C(P),window.location.hash=i}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(i)}(u(9));break;case"title":!function(e,i){w[i]?.syncTitle&&(w[i].iframe.title=e)}(H.msg,P);break;case"reset":S(H);break;case"init":a(),function(e){try{w[e].sameDomain=!!w[e]?.iframe?.contentWindow?.iframeChildListener}catch(i){w[e].sameDomain=!1}}(P),(i=H.msg)!==e&&(void 0!==i||d(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")),L=!0,O("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void c(P,`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;a()}var i,t}())):c("","iframeResizer received messageData without id, message was: ",A)):Object.keys(w).forEach((e=>{w[e].mode>=0&&x("iFrame requested init",W(e),e)}))}function j(e,i,t){let n=null,o=null;if(w[e]){if(n=w[e][i],"function"!=typeof n)throw new TypeError(`${i} on iFrame[${e}] is not a function`);"onClose"===i||"onScroll"===i?o=n(t):setTimeout((()=>n(t)))}return o}function k(e){const{id:i}=e;delete w[i]}function T(e){const i=e.id;if(!1!==j(i,"onClose",i)){try{e.parentNode&&e.remove()}catch(e){c(i,e)}j(i,"onClosed",i),k(e)}}function R(e){null===v.position&&(v.position={x:window.scrollX,y:window.scrollY})}function $(){v.position=null}function I(e){null!==v.position&&(window.scrollTo(v.position.x,v.position.y),$())}function S(e){R(e.id),M(e),x("reset","reset",e.id)}function M(e){const i=e.id;function t(i){const t=`${e[i]}px`;e.iframe.style[i]=t}w[i].sizeHeight&&t("height"),w[i].sizeWidth&&t("width")}function x(e,t,n,o){w[n]&&(w[n]?.postMessageTarget?function(){const{postMessageTarget:e,targetOrigin:o}=w[n];if(w[n].sameDomain)try{return void w[n].iframe.contentWindow.iframeChildListener(i+t)}catch(e){}e.postMessage(i+t,o)}():c(n,`[${e}] IFrame(${n}) not found`),o&&w[n]?.warningTimeout&&(w[n].msgTimeout=setTimeout((function(){if(void 0===w[n])return;const{iframe:e,loaded:i,loadErrorShown:t,waitForLoad:o}=w[n],{sandbox:r}=e;i||t||(w[n].loadErrorShown=!0,d(n,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${w[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}\n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values."}\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[n].warningTimeout)))}function W(e){const i=w[e];return[e,"8",i.sizeWidth,i.log,"32",!0,i.autoResize,i.bodyMargin,i.heightCalculationMethod,i.bodyBackground,i.bodyPadding,i.tolerance,i.inPageLinks,"child",i.widthCalculationMethod,i.mouseEvents,i.offsetHeight,i.offsetWidth,i.sizeHeight,i.license,v.version,i.mode].join(":")}let F=0,L=!1,N=!1;const C=i=>t=>{function r(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)&&d(s,'<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 a(e){const i=w[e]?.iframe?.title;return""===i||void 0===i}const s=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=i?.id||b.id+F++;return null!==document.getElementById(e)&&(e+=F++),e}(),t.id=e,(i||{}).log),e}(t.id);return s in w&&"iFrameResizer"in t?c(s,"Ignored iFrame, already setup."):(function(e){var i,n;w[s]={iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...b,...r(e),mode:g(e),syncTitle:a(s)},function(){if("horizontal"===w[s].direction)return w[s].sizeWidth=!0,void(w[s].sizeHeight=!1);if("none"===w[s].direction)return w[s].sizeWidth=!1,w[s].sizeHeight=!1,void(w[s].autoResize=!1);if("vertical"!==w[s].direction)throw new TypeError(s,`Direction value of "${w[s].direction}" is not valid`)}(),(i=e?.offsetSize||e?.offset)&&("vertical"===w[s].direction?w[s].offsetHeight=i:w[s].offsetWidth=i),e?.offset&&d(s,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===w[s].postMessageTarget&&(w[s].postMessageTarget=t.contentWindow),w[s].targetOrigin=!0===w[s].checkOrigin?""===(n=w[s].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(i),function(){const{mode:i}=w[s];i<0&&d("Parent",`${y(i+2)}${y(2)}`),N||i<0||(N=!0,((e,...i)=>{l("info",e,...i)})(`v${e} (${(e=>f(m[e]))(i)})`),i<1&&d("Parent",y(3)))}(),O(),function(){switch(t.style.overflow=!1===w[s]?.scrolling?"hidden":"auto",w[s]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=w[s]?w[s].scrolling:"no"}}(),function(){const{bodyMargin:e}=w[s];"number"!=typeof e&&"0"!==e||(w[s].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t;-1!==w[i].mode&&-2!==w[i].mode&&(o(t,"load",(function(){x("iFrame.onload",`${e}:${L}`,i,!0),function(){const e=w[s]?.firstRun,i=w[s]?.heightCalculationMethod in n;!e&&i&&S({iframe:t,height:0,width:0,type:"init"})}()})),!1===w[i].waitForLoad&&x("init",`${e}:${L}`,i,!0))}(W(s)),function(){if(w[s]){const e={close:T.bind(null,w[s].iframe),disconnect:k.bind(null,w[s].iframe),removeListeners(){d(s,"\n<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize:x.bind(null,"Window resize","resize",s),moveToAnchor(e){x("Move to anchor",`moveToAnchor:${e}`,s)},sendMessage(e){x("Send Message",`message:${e=JSON.stringify(e)}`,s)}};w[s].iframe.iframeResizer=e,w[s].iframe.iFrameResizer=e}}()),t?.iFrameResizer};function E(){!1===document.hidden&&function(e,i){const t=e=>w[e]?.autoResize&&!w[e]?.firstRun;Object.keys(w).forEach((function(n){t(n)&&x(e,i,n)}))}("Tab Visible","resize")}const O=(e=>{let i=!1;return function(){return i?void 0:(i=!0,Reflect.apply(e,this,arguments))}})((()=>{o(window,"message",z),o(document,"visibilitychange",E),window.iframeParentListener=e=>setTimeout((()=>z({data:e,sameDomain:!0})))}));switch(!0){case void 0===window.jQuery:c("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:c("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:c("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const i=C(e);return this.filter("iframe").each(((e,t)=>i(t))).end()},window.jQuery.fn.iFrameResize=function(e){return c("","Deprecated: Use the iframeResize method instead of iFrameResize"),this.iframeResize(e)}}}));
|
|
20
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.3.1",i="[iFrameSizer]",t=i.length,n=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),o=(e,i,t,n)=>e.addEventListener(i,t,n||!1),r=(e,i,t)=>e.removeEventListener(i,t,!1),a=e=>{if(!e)return"";let i=-559038744,t=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),i=Math.imul(i^n,2246822519),t=Math.imul(t^n,3266489917);return i^=Math.imul(i^t>>>15,1935289751),t^=Math.imul(t^i>>>15,3405138345),i^=t>>>16,t^=i>>>16,(2097152*(t>>>0)+(i>>>11)).toString(36)},s=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),l=["<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</>."],c=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],d=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,i)=>[e,Math.max(0,i-1)]))),u=e=>s(l[e]),f=e=>{const i=e[s("spjluzl")];if(!i)return-1;const t=i.split("-");let n=function(e=""){let i=-2;const t=a(s(e));return t in d&&(i=d[t]),i}(t[0]);return 0===n||(e=>e[2]===a(e[0]+e[1]))(t)||(n=-2),n},p="[iframe-resizer]";const h=e=>`${p}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(e)}]`,m=(e,...i)=>((e,i,...t)=>window?.console[e](h(i),...t))("warn",e,...i),y=(e,i)=>console?.warn((e=>i=>window.chrome?e(i.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(i.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((e=>(...i)=>[`${p}[${e}]`,...i].join(" "))(e))(i)),g={},w=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 g[e.id].onInit&&(y(e.id,"\n[31;1mDeprecated Option[m\n\nThe [1monInit()[m function is deprecated and has been replaced with [1monReady()[m. It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),b={position:null,version:e};function v(n){function a(){I(H),R(),O("onResized",H)}function s(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)}const c=e=>A.slice(A.indexOf(":")+7+e);const d=(e,i)=>(t,n)=>{const o={};var r,a;r=function(){M(`Send ${e} (${t})`,`${e}:${i()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},u=(e,i)=>()=>{let t=!1;const n=i=>()=>{g[d]?t&&t!==i||(e(i,d),t=i,requestAnimationFrame((()=>{t=!1}))):c()},a=n("scroll"),s=n("resize window");function l(e,i){i(window,"scroll",a),i(window,"resize",s)}function c(){l(0,r),u.disconnect(),f.disconnect()}const d=P,u=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));l(0,o),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[d].iframe,{attributes:!0,childList:!1,subtree:!1}),g[d]&&(g[d][`stop${i}`]=c)},f=e=>()=>{e in g[P]&&(g[P][e](),delete g[P][e])},p=d("pageInfo",(function(){const e=document.body.getBoundingClientRect(),i=H.iframe.getBoundingClientRect(),{scrollY:t,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(i.top-e.top,10),offsetLeft:parseInt(i.left-e.left,10),scrollTop:t,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),h=d("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:i,scrollHeight:t}=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:i,scrollHeight:t},viewport:{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),w=u(p,"PageInfo"),v=u(h,"ParentInfo"),j=f("stopPageInfo"),W=f("stopParentInfo");function L(e){const i=e.getBoundingClientRect();return T(),{x:Number(i.left)+Number(b.position.x),y:Number(i.top)+Number(b.position.y)}}function N(e){const i=e?L(H.iframe):{x:0,y:0},t=((e,i)=>({x:e.width+i.x,y:e.height+i.y}))(H,i),n=window.parentIframe||window.parentIFrame;n?function(i,t){i["scrollTo"+(e?"Offset":"")](t.x,t.y)}(n,t):function(e){b.position=e,C(P)}(t)}function C(e){const{x:i,y:t}=b.position,n=g[e]?.iframe;!1!==O("onScroll",{iframe:n,top:t,left:i,x:i,y:t})?R():$()}function E(e){let i={};if(0===H.width&&0===H.height){const e=c(9).split(":");i={x:e[1],y:e[0]}}else i={x:H.width,y:H.height};O(e,{iframe:H.iframe,screenX:Number(i.x),screenY:Number(i.y),type:H.type})}const O=(e,i)=>z(P,e,i);let A=n.data,H={},P=null;"[iFrameResizerChild]Ready"!==A?i===`${A}`.slice(0,t)&&A.slice(t).split(":")[0]in g&&(H=function(){const e=A.slice(t).split(":"),i=e[1]?Number(e[1]):0,n=g[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:i+s(o)+l(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),P=H.id,P?(function(e){if(!g[e])throw new Error(`${H.type} No settings for ${e}. Message was: ${A}`)}(P),H.type in{true:1,false:1,undefined:1}||(g[P].loaded=!0,(null!==H.iframe||(m(P,`The iframe (${H.id}) was not found.`),0))&&function(){const{origin:e,sameDomain:i}=n;if(i)return!0;let t=g[P]?.checkOrigin;if(t&&"null"!=`${e}`&&!(t.constructor===Array?function(){let i=0,n=!1;for(;i<t.length;i++)if(t[i]===e){n=!0;break}return n}():function(){const i=g[P]?.remoteHost;return e===i}()))throw new Error(`Unexpected message received from: ${e} for ${H.iframe.id}. Message was: ${n.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[P]?.firstRun&&g[P]&&(g[P].firstRun=!1),H.type){case"close":k(H.iframe);break;case"message":t=c(6),O("onMessage",{iframe:H.iframe,message:JSON.parse(t)});break;case"mouseenter":E("onMouseEnter");break;case"mouseleave":E("onMouseLeave");break;case"autoResize":g[P].autoResize=JSON.parse(c(9));break;case"scrollBy":!function(){const e=H.width,i=H.height;(window.parentIframe||window).scrollBy(e,i)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":p("start",P),w();break;case"parentInfo":h("start",P),v();break;case"pageInfoStop":j();break;case"parentInfoStop":W();break;case"inPageLink":!function(e){const i=e.split("#")[1]||"",t=decodeURIComponent(i);let n=document.getElementById(t)||document.getElementsByName(t)[0];n?function(){const e=L(n);b.position={x:e.x,y:e.y},C(P),window.location.hash=i}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(i)}(c(9));break;case"title":!function(e,i){g[i]?.syncTitle&&(g[i].iframe.title=e)}(H.msg,P);break;case"reset":S(H);break;case"init":a(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(i){g[e].sameDomain=!1}}(P),(i=H.msg)!==e&&(void 0!==i||y(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")),F=!0,O("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void m(P,`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;a()}var i,t}())):m("","iframeResizer received messageData without id, message was: ",A)):Object.keys(g).forEach((e=>{g[e].mode>=0&&M("iFrame requested init",x(e),e)}))}function z(e,i,t){let n=null,o=null;if(g[e]){if(n=g[e][i],"function"!=typeof n)throw new TypeError(`${i} on iFrame[${e}] is not a function`);"onClose"===i||"onScroll"===i?o=n(t):setTimeout((()=>n(t)))}return o}function j(e){const{id:i}=e;delete g[i]}function k(e){const{id:i}=e;if(!1!==z(i,"onClose",i)){try{e.parentNode&&e.remove()}catch(e){m(i,e)}z(i,"onClosed",i),j(e)}}function T(e){null===b.position&&(b.position={x:window.scrollX,y:window.scrollY})}function $(){b.position=null}function R(e){null!==b.position&&(window.scrollTo(b.position.x,b.position.y),$())}function S(e){T(e.id),I(e),M("reset","reset",e.id)}function I(e){function i(i){const t=`${e[i]}px`;e.iframe.style[i]=t}const{id:t}=e,{sizeHeight:n,sizeWidth:o}=g[t];n&&i("height"),o&&i("width")}function M(e,t,n,o){g[n]&&(g[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:r,targetOrigin:a}=g[n];if(r)try{return void e.contentWindow.iframeChildListener(i+t)}catch(e){}o.postMessage(i+t,a)}():m(n,`[${e}] IFrame(${n}) not found`),o&&g[n]?.warningTimeout&&(g[n].msgTimeout=setTimeout((function(){if(void 0===g[n])return;const{iframe:e,loaded:i,loadErrorShown:t,waitForLoad:o}=g[n],{sandbox:r}=e;i||t||(g[n].loadErrorShown=!0,y(n,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${g[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}\n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values."}\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`))}),g[n].warningTimeout)))}function x(e){const i=g[e];return[e,"8",i.sizeWidth,i.log,"32",!0,i.autoResize,i.bodyMargin,i.heightCalculationMethod,i.bodyBackground,i.bodyPadding,i.tolerance,i.inPageLinks,"child",i.widthCalculationMethod,i.mouseEvents,i.offsetHeight,i.offsetWidth,i.sizeHeight,i.license,b.version,i.mode].join(":")}let W=0,F=!1,L=!1;const N=i=>t=>{function r(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)&&y(l,'<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 a(e){const i=g[e]?.iframe?.title;return""===i||void 0===i}const l=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=i?.id||w.id+W++;return null!==document.getElementById(e)&&(e+=W++),e}(),t.id=e,(i||{}).log),e}(t.id);return l in g&&"iFrameResizer"in t?m(l,"Ignored iFrame, already setup."):(function(e){var i,n;g[l]={iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...w,...r(e),mode:f(e),syncTitle:a(l)},function(){const{direction:e}=g[l];if("horizontal"===e)return g[l].sizeWidth=!0,void(g[l].sizeHeight=!1);if("none"===e)return g[l].sizeWidth=!1,g[l].sizeHeight=!1,void(g[l].autoResize=!1);if("vertical"!==e)throw new TypeError(l,`Direction value of "${e}" is not valid`)}(),(i=e?.offsetSize||e?.offset)&&("vertical"===g[l].direction?g[l].offsetHeight=i:g[l].offsetWidth=i),e?.offset&&y(l,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===g[l].postMessageTarget&&(g[l].postMessageTarget=t.contentWindow),g[l].targetOrigin=!0===g[l].checkOrigin?""===(n=g[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(i),function(){const{mode:i}=g[l];var t;i<0&&y("Parent",`${u(i+2)}${u(2)}`),L||i<0||(L=!0,t=`v${e} (${(e=>s(c[e]))(i)})`,console.info(`%c[iframe-resizer] ${t}`,"font-weight: bold;"),i<1&&y("Parent",u(3)))}(),E(),function(){switch(t.style.overflow=!1===g[l]?.scrolling?"hidden":"auto",g[l]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=g[l]?g[l].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[l];"number"!=typeof e&&"0"!==e||(g[l].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t,{mode:r,waitForLoad:a}=g[i];-1!==r&&-2!==r&&(o(t,"load",(function(){M("iFrame.onload",`${e}:${F}`,i,!0),function(){const e=g[l]?.firstRun,i=g[l]?.heightCalculationMethod in n;!e&&i&&S({iframe:t,height:0,width:0,type:"init"})}()})),!1===a&&M("init",`${e}:${F}`,i,!0))}(x(l)),function(){if(g[l]){const{iframe:e}=g[l],i={close:k.bind(null,e),disconnect:j.bind(null,e),removeListeners(){y(l,"\n<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize:M.bind(null,"Window resize","resize",l),moveToAnchor(e){M("Move to anchor",`moveToAnchor:${e}`,l)},sendMessage(e){M("Send Message",`message:${e=JSON.stringify(e)}`,l)}};e.iframeResizer=i,e.iFrameResizer=i}}()),t?.iFrameResizer};function C(){!1===document.hidden&&function(e,i){const t=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){t(n)&&M(e,i,n)}))}("Tab Visible","resize")}const E=(e=>{let i=!1;return function(){return i?void 0:(i=!0,Reflect.apply(e,this,arguments))}})((()=>{o(window,"message",v),o(document,"visibilitychange",C),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))}));switch(!0){case void 0===window.jQuery:m("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:m("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:m("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const i=N(e);return this.filter("iframe").each(((e,t)=>i(t))).end()},window.jQuery.fn.iFrameResize=function(e){return m("","Deprecated: Use the iframeResize method instead of iFrameResize"),this.iframeResize(e)}}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iframe-resizer/jquery",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.1",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"homepage": "https://iframe-resizer.com",
|
|
6
6
|
"author": {
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
"jquery"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@iframe-resizer/core": "5.3.
|
|
42
|
+
"@iframe-resizer/core": "5.3.1"
|
|
43
43
|
}
|
|
44
44
|
}
|