Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum https://www.tinywebgallery.com/forum/ |
|
Feedback URL handling https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4930 |
Page 1 of 2 |
Author: | TinyWebGallery [ 31. Jul 2018, 08:39 ] |
Post subject: | Re: Feedback URL handling |
So you have an iframe inside your iframe. It seems that this is in full control of www.planyo.com. I think the problem is as they work inside an iframe already they use target="_blank" to jump outside the iframe. Can you check which targets they have set? it should be _parent So you could ask them to change this. As this is on the same domain you have access to this iframes if domains really match. you have www.planyo.com and planyo.com which is for a browser a different domain. This needs to be aligned. then you could write some Javascript which does change link targets. I have such code already in my plugin but you need this then not for the current page but inside the iframe. Best, Michael |
Author: | TinyWebGallery [ 31. Jul 2018, 21:17 ] |
Post subject: | Re: Feedback URL handling |
are you now able to use www.p... everywhere. I don'T see the problem. Have you already checked which targets the calender links do have? If the resize is not working please check the javascript console. Maybe something from my plugin is reported there. Sometimes you need to e.g. add a timeout if something is loaded dynamically. Best, Michael |
Author: | Castleland [ 1. Aug 2018, 12:57 ] |
Post subject: | Re: Feedback URL handling |
Right-clicking on the calendar shows the following type of link: Code: <td class="cur_month_day_nox nocuscol" onclick="window.open('https://www.planyo.com/booking.php?planyo_lang=EN&mode=reserve&prefill=true&time_mode=full_day&one_date=08%20Aug%202018&start_date=08%20Aug%202018&resource_id=104777')">8</td> For every date on the calendar etc.. That's all I can see. I'm still waiting on a response about the "_parent" question from the developers, hopefully they'll be willing to change it from "_blank" Quote: If the resize is not working please check the javascript console. Maybe something from my plugin is reported there. Sometimes you need to e.g. add a timeout if something is loaded dynamically. This is what is happening on the page that isn't resizing in the console: Code: Advanced iframe configuration error: You have enabled the resize of the iframe for pages on the same domain. But you use an iframe page on a different domain. You need to use the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed. ai.js?ver=311305:62 DOMException: Blocked a frame with origin "http://dicdevelopmenttrust.com" from accessing a cross-origin frame. at aiResizeIframe (http://dicdevelopmenttrust.com/Redux/wp-content/plugins/advanced-iframe/js/ai.js?ver=311305:23:36) at recalculateIframeadvanced_iframe (http://dicdevelopmenttrust.com/home/makeabooking/:347:75) at <anonymous>:1:1 ai.js?ver=311305:61 Advanced iframe configuration error: You have enabled the resize of the iframe for pages on the same domain. But you use an iframe page on a different domain. You need to use the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed. ai.js?ver=311305:62 DOMException: Blocked a frame with origin "http://dicdevelopmenttrust.com" from accessing a cross-origin frame. at aiResizeIframe (http://dicdevelopmenttrust.com/Redux/wp-content/plugins/advanced-iframe/js/ai.js?ver=311305:23:36) at recalculateIframeadvanced_iframe (http://dicdevelopmenttrust.com/home/makeabooking/:347:75) at <anonymous>:1:1 I've added a 500ms timeout, but it didn't make a difference. |
Author: | Castleland [ 1. Aug 2018, 14:04 ] |
Post subject: | Re: Feedback URL handling |
Weirdly I've noticed if you load a page from the page that isn't working and then go back to it, the resize is working https://drive.google.com/open?id=13zFF9yMDzGkTcyuz6NMFrdJ-Tp_w-047 |
Author: | TinyWebGallery [ 1. Aug 2018, 22:47 ] |
Post subject: | Re: Feedback URL handling |
The use window open. So actually Therefore _parent would not work. how have you configured resize on element resize? Seems you have enabled it for the same domain! make sure you have added use_shortcode_attributes_only="true" or enable_external_height_workaround="true" Best, Michael |
Author: | Castleland [ 3. Aug 2018, 12:10 ] |
Post subject: | Re: Feedback URL handling |
Hi Michael, I've modified the shortcode to this: Code: [advanced_iframe src="https://www.planyo.com/booking.php?calendar=34264&mode=resource_list&planyo_lang=EN" width="100%" height="100%" id="advanced_iframe" hide_page_until_loaded="true" show_iframe_loader="true" enable_responsive_iframe="true" onload_resize="true" resize_on_ajax="100" resize_on_ajax_jquery="false" multi_domain_enabled="true" use_post_message="true" enable_external_height_workaround="true" ] And here is the ai-external.js contents: Code: // load an external config from the inital site. Param config_id is checked from the url. var doIt = loadExternalConfig(domain_advanced_iframe); if (doIt) { // Variables are checked with typeof before because this enables that the user can // define this values before and after including this file and they don't have to set // them at all if not needed. var iframe_id_advanced_iframe; if (typeof iframe_id === 'undefined') { iframe_id_advanced_iframe = 'advanced_iframe'; } else { /* jshint ignore:start */ iframe_id_advanced_iframe = iframe_id; /* jshint ignore:end */ } var iframe_advanced_iframe_last_height = -1; if (typeof iframe_url_id === 'undefined') { var iframe_url_id = ''; } // multisite support if (typeof domainMultisite === 'undefined') { var domainMultisite = 'true'; } if (typeof post_message_domain === 'undefined') { var post_message_domain = '*'; } if (domainMultisite === 'true') { // Check the referer var ref = document.referrer; // If found we exchange the domain. if (ref !== '') { var domainOrig = domain_advanced_iframe.split('/')[2]; var multiDomain = ref.split('/')[2]; domain_advanced_iframe = domain_advanced_iframe.replace(domainOrig, multiDomain); } post_message_domain = '*'; } if (typeof usePostMessage === 'undefined') { var usePostMessage = true; } if (typeof debugPostMessage === 'undefined') { var debugPostMessage = false; } if (typeof dataPostMessage === 'undefined') { var dataPostMessage = ''; } if (iframe_url_id !== '') { var value_id = aiGetUrlParameter(iframe_url_id); if (value_id !== '') { iframe_id_advanced_iframe = value_id; } else { var errorText = 'Configuration error: The id cannot be found in the url at the configured parameter.'; alert(errorText); throw errorText; } } if (typeof updateIframeHeight === 'undefined') { var updateIframeHeight = 'true'; } if (typeof onload_resize_delay === 'undefined') { var onload_resize_delay = 300; } if (typeof keepOverflowHidden === 'undefined') { var keepOverflowHidden = 'false'; } if (typeof hide_page_until_loaded_external === 'undefined') { var hide_page_until_loaded_external = 'false'; } if (typeof iframe_hide_elements === 'undefined') { var iframe_hide_elements = ''; } if (typeof onload_show_element_only === 'undefined') { var onload_show_element_only = ''; } if (typeof iframe_content_id === 'undefined') { var iframe_content_id = ''; } if (typeof iframe_content_styles === 'undefined') { var iframe_content_styles = ''; } if (typeof change_iframe_links === 'undefined') { var change_iframe_links = ''; } if (typeof change_iframe_links_target === 'undefined') { var change_iframe_links_target = ''; } if (typeof additional_js_file_iframe === 'undefined') { var additional_js_file_iframe = ''; } if (typeof additional_js_iframe === 'undefined') { var additional_js_iframe = ''; } if (typeof additional_css_file_iframe === 'undefined') { var additional_css_file_iframe = ''; } if (typeof iframe_redirect_url === 'undefined') { var iframe_redirect_url = ''; } if (typeof enable_responsive_iframe === 'undefined') { var enable_responsive_iframe = 'true'; } if (typeof write_css_directly === 'undefined') { var write_css_directly = 'false'; } if (typeof resize_on_element_resize === 'undefined') { var resize_on_element_resize = 'div#top_container'; } if (typeof resize_on_element_resize_delay === 'undefined') { var resize_on_element_resize_delay = ''; } if (typeof add_iframe_url_as_param === 'undefined') { var add_iframe_url_as_param = 'false'; } if (typeof element_to_measure === 'undefined') { var element_to_measure = 'default'; } if (typeof element_to_measure_offset === 'undefined') { var element_to_measure_offset = 0; } var modify_iframe_cookie_found = false; if (typeof modify_iframe_if_cookie === 'undefined') { var modify_iframe_if_cookie = false; } // This is a feature only mentioned in the readme.txt as it was only needed for a custom solution. if (typeof additional_styles_wrapper_div === 'undefined') { var additional_styles_wrapper_div = ''; } if (typeof add_css_class_iframe === 'undefined') { var add_css_class_iframe = 'false'; } if (typeof send_console_log === 'undefined') { var send_console_log = false; } // read optional jquery and resize on element resize paths! if (typeof jquery_path === 'undefined') { var jquery_path = 'http://dicdevelopmenttrust.com/Redux/wp-includes/js/jquery/jquery.js'; } var iframeWidth = 0; var ia_resize_init_done_advanced_iframe = false; // redirect to a given url if the page is NOT in an iframe if (iframe_redirect_url !== '') { /* Add existing parameters */ if ('' !== window.location.search && iframe_redirect_url.indexOf('?') ===-1) { iframe_redirect_url += window.location.search; } if (window===window.top) { /* I'm not in a frame! */ location.replace(iframe_redirect_url); } else { /* we check if the referrer is the parent */ var ref = document.referrer; if (ref !== '') { var domainRedirect = iframe_redirect_url.split('/')[2]; var domainRef = ref.split('/')[2]; if (domainRedirect !== domainRef) { top.location.replace(iframe_redirect_url); } } else { /* If no referer is found we redirect to the defined parent as this seems to be a fake include */ top.location.replace(iframe_redirect_url); } } } // load jQuery if not available window.jQuery || document.write('<script src="' + jquery_path + '"></script>'); // if responsive is enabled auto height has to be enabled as well. if (enable_responsive_iframe === 'true') { updateIframeHeight = 'true'; } var modificationCookieSet = false; if (modify_iframe_if_cookie) { modificationCookieSet = getCookie("aiIframeModifications") == "true"; } if (typeof ia_already_done === 'undefined') { if (window!==window.top || modificationCookieSet) { /* I'm in a frame! */ // dom is not fully loaded therefore jQuery is not used to hide the body! if (iframe_hide_elements !== '' || onload_show_element_only !== '' || iframe_content_id !== '' || iframe_content_styles !== '') { if (document.documentElement && write_css_directly === 'false') { document.documentElement.style.visibility = 'hidden'; } // Solution if you want to remove the background but you see it for a very short time. // because hiding the iframe content does not help! //if (window != window.top) { // document.write("<style>body { background-image: none; }</style>"); //} } } var ia_already_done = false; } // add the aiUpdateIframeHeight to the onload of the site. addOnloadEvent(aiExecuteWorkaround_advanced_iframe); if (write_css_directly === 'true' && (window!==window.top || modificationCookieSet)) { writeCssDirectly(); } if (additional_css_file_iframe !== '' && (window!==window.top || modificationCookieSet)) { document.write('<link rel="stylesheet" type="text/css" href="' + additional_css_file_iframe + '"/>'); } if (additional_js_file_iframe !== '' && (window!==window.top || modificationCookieSet)) { document.write('<script src="'+additional_js_file_iframe+'"></script>'); } if (additional_js_iframe !== '' && (window!==window.top || modificationCookieSet)) { document.write('<script>' + additional_js_iframe + '<\/script>'); } // we overwrite console.log if it exists if (usePostMessage && send_console_log && console && console.log) { console.log = function() { var data = { 'aitype' : 'debug', 'id' : iframe_id_advanced_iframe, 'data' : [].map.call(arguments, JSON.stringify) }; var json_data = JSON.stringify(data); parent.postMessage(json_data, post_message_domain); }; window.onerror = function (msg, url, lineNo, columnNo, error) { var data = { 'aitype' : 'debug', 'id' : iframe_id_advanced_iframe, 'data' : 'ERROR: ' + msg + ' - ' + lineNo + ':' + columnNo }; var json_data = JSON.stringify(data); parent.postMessage(json_data, post_message_domain); }; } } There aren't JS errors in the developer console since I've changed the shortcode, but it's still doing it |
Author: | TinyWebGallery [ 3. Aug 2018, 16:07 ] |
Post subject: | Re: Feedback URL handling |
onload_resize="true" resize_on_ajax="100" resize_on_ajax_jquery="false" are only for the same domain. resize_on_element_resize_delay is empty. can you set this please to a vaild number? And what do you mean with doing it? Best, Michael |
Author: | Castleland [ 3. Aug 2018, 16:46 ] |
Post subject: | Re: Feedback URL handling |
Ok, I've removed the redundant shortcode entries. Quote: resize_on_element_resize_delay is empty. can you set this please to a vaild number? Changed it to 100. Code: 2(index):337 Uncaught DOMException: Blocked a frame with origin "http://dicdevelopmenttrust.com" from accessing a cross-origin frame. at HTMLIFrameElement.onload (http://dicdevelopmenttrust.com/home/makeabooking/:337:1431) https://cdn.rawgit.com/Castleland/Iframer/ec32efc6/ai-external.js Quote: And what do you mean with doing it? The shopping cart pager page is still showing a scrollbar on initial load, but not after reloading it. As shown in the video: https://drive.google.com/file/d/13zFF9yMDzGkTcyuz6NMFrdJ-Tp_w-047/view Thanks again Michael. |
Author: | TinyWebGallery [ 3. Aug 2018, 20:56 ] |
Post subject: | Re: Feedback URL handling |
1. about the iframe exception. http://dicdevelopmenttrust.com/home/makeabooking/ does not exists. so where do you get this? 2. if it does not work the first time but after a reload then maybe the timing is a problem. You can delay the first resize. On the external workaround tab there is a option for this. also you can set multi_domain_enabled="true" use_post_message="true" in the administration directly then you don't need this at the shortcode. also you should set use_post_message="debug" there because then the console log does report when a size was sent/received. Best, Michael |
Author: | Castleland [ 6. Aug 2018, 15:56 ] |
Post subject: | Re: Feedback URL handling |
Hi Michael, thanks again for the response. Quote: 1. about the iframe exception. http://dicdevelopmenttrust.com/home/makeabooking/ does not exists. so where do you get this? It does exist, it's just private, so only works if you're logged in. I've made it public now so you can see it. Quote: 2. if it does not work the first time but after a reload then maybe the timing is a problem. You can delay the first resize. On the external workaround tab there is a option for this. Here is the output of the debug console and postmessage debug enabled, going from start page all the way to the shopping cart page: Code: User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36 Headers of https://www.planyo.com/booking.php?calendar=34264&mode=resource_list&planyo_lang=EN: HTTP/1.1 200 OK Cache-Control: no-store, no-cache, must-revalidate Content-Type: text/html; charset=UTF-8 Date: Mon, 06 Aug 2018 13:44:57 GMT Expires: Thu, 19 Nov 1981 08:52:00 GMT Pragma: no-cache Server: Apache Set-Cookie: PHPSESSID=tk9mqko1ma3pn3tjfkcu4turr6; path=/ Set-Cookie: PHPSESSID=04110l99je5m6p3j02lv6scp13; path=/ X-Powered-By: PHP/7.0.30 Connection: keep-alive Set-Cookie: visid_incap_836884=nPB40ARRSoGpSM/Ao9PxptlQaFsAAAAAQUIPAAAAAABwS7FTmz1/rs2m0XJe/Vbs; expires=Tue, 06 Aug 2019 09:19:15 GMT; path=/; Domain=.planyo.com Set-Cookie: nlbi_836884=X/hTJYD0fHTI/yVy7dRC8AAAAABmtof6+iAdw09/6BpA0VTu; path=/; Domain=.planyo.com Set-Cookie: incap_ses_459_836884=wETjQ8QqoxP536tJHbNeBtlQaFsAAAAAjDR8RZiUKH5WAWjHL3VQ2w==; path=/; Domain=.planyo.com Set-Cookie: ___utmvmvEuKYoX=uvFyZfzdPvs; path=/; Max-Age=900 Set-Cookie: ___utmvavEuKYoX=eiIlHRr; path=/; Max-Age=900 Set-Cookie: ___utmvbvEuKYoX=qZV XzeOqalH: wti; path=/; Max-Age=900 X-Iinfo: 7-127277306-127277311 NNNN CT(0 0 0) RT(1533563097559 28) q(0 0 0 -1) r(4 4) U6 X-CDN: Incapsula The page does exist and no X-Frame-Options header was found. But there can still be a iframe blocker script on this page. Go here for a full check. ERROR: Uncaught SecurityError: Blocked a frame with origin "http://dicdevelopmenttrust.com" from accessing a cross-origin frame. - 396:1205 l: "postMessage received: !_{\"h\":\"\"} - origin: https://docs.google.com" l: "The received message cannot be parsed and seems not to belong to advanced iframe pro. Please disable the postMessage debug mode if this o.k. and that this message is not shown anymore." l: {} l: "postMessage received: !_{\"h\":\"\"} - origin: https://docs.google.com" l: "The received message cannot be parsed and seems not to belong to advanced iframe pro. Please disable the postMessage debug mode if this o.k. and that this message is not shown anymore." l: {} l: "postMessage received: {\"aitype\":\"height\",\"height\":2109,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" ERROR: Uncaught SecurityError: Blocked a frame with origin "http://dicdevelopmenttrust.com" from accessing a cross-origin frame. - 396:1205 l: "postMessage received: {\"aitype\":\"height\",\"height\":159,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":1912,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":2018,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":2040,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":143,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":766,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":847,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":874,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":381,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" ERROR: Uncaught SecurityError: Blocked a frame with origin "http://dicdevelopmenttrust.com" from accessing a cross-origin frame. - 396:1205 l: "postMessage received: {\"aitype\":\"height\",\"height\":1131,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" ERROR: Uncaught SecurityError: Blocked a frame with origin "http://dicdevelopmenttrust.com" from accessing a cross-origin frame. - 396:1205 l: "postMessage received: {\"aitype\":\"height\",\"height\":1831,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":2109,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" ERROR: Uncaught SecurityError: Blocked a frame with origin "http://dicdevelopmenttrust.com" from accessing a cross-origin frame. - 396:1205 l: "postMessage received: {\"aitype\":\"height\",\"height\":159,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" l: "postMessage received: {\"aitype\":\"height\",\"height\":381,\"width\":1170,\"id\":\"advanced_iframe\",\"data\":{}} - origin: https://www.planyo.com" The times with 381 as the height are the shopping cart page. First time with scroll bar. Second time resized fine. I've changed the delay to 800ms but it hasn't made much of a difference. |
Author: | TinyWebGallery [ 7. Aug 2018, 08:23 ] |
Post subject: | Re: Feedback URL handling |
can you check who is doing this: ERROR: Uncaught SecurityError: Blocked a frame with origin "http://dicdevelopmenttrust.com" from accessing a cross-origin frame. so the 159 is the height with his too small and 381 then the correct one? The delay is 300 ms. Maybe this is not enough. and also is div#top_container the element that does change the size after load on this page also? Best, Michael |
Author: | TinyWebGallery [ 7. Aug 2018, 20:40 ] |
Post subject: | Re: Feedback URL handling |
So you think the resize itself is not working properly at this point. If I open the js directly I still see the 300. But you can try to set it to e.g. 5000 and reload the js that it is now cached. Then you see if the anchor is doing some harm here. |
Page 1 of 2 | All times are UTC + 1 hour [ DST ] |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |