Hi,
Thank you for this great module! I come across this posting about the possibility of crossdomain iframe resizing, as long as one is able to make a small change on the remote site as describe here. http://stackoverflow.com/questions/153152/resizing-an-iframe-based-on-content
is it possible at all to implement this to insertFrame?
Thanks,
Iwan
p.s: total noob here, so will need guidance if anything is expected for me to test, etc ...
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | insertFrame.zip | 13.35 KB | MarcElbichon |
| #11 | insertFrame.zip | 13.38 KB | MarcElbichon |
Comments
Comment #1
MarcElbichon commentedWhat implementation do you want ?
I only can expose javascript function to resize iframe with a height argument. this can be done by your own by modifying insertFrame.js
Comment #2
iwanaws commentedguide for dummy will be appreciated.
I assumed part of the steps is that I'll need to insert the code in the remote page and creating helper.html but I wouldn't know how to modify or which part to add/change in insertFrame.js .
Comment #3
MarcElbichon commentedAdd this code to insertFrame.js
You now can call resizeFrame(...) from your child page.
IMPORTANT : This function works only if your iframe is named iframe1 (default). If not, change the name in the function or pass it to child via url and call resizeFrameByName(...).
Comment #4
iwanaws commentedI couldn't get this to work. maybe i am missing something obvious and silly.
here is what i've done.
- add the code that you've provided to insertFrame.js
- add code below to target iframe
- created helper.html with below code
Can you kindly check what i am missing? thx!
Comment #5
MarcElbichon commentedin helper.html change
parent.parent.resizeframe(height);
to
parent.parent.resizeFrame(height);
Comment #6
iwanaws commentedI fixed the typo, but it still not working as expected. oh well ... it's minor issue. it's one of those thing that would be nice to work but can do without. i'll use continue to use height manually for crossdomain pages. thanks for the effort.
Comment #7
MarcElbichon commentedI've tried your code (with pages in the same domain) and it works.
Have you flushed Drupal cache ?
Can you send me an url for debugging with firebug ?
Comment #8
iwanaws commentedsorry for the late reply, didn't know there was more reply on this issue.
anyway, I redo the steps again testing both on same domain and crossdomain. I can confirmed that it works as intended for same domain, but doesn't work for crossdomain (which is my intention of getting it to work).
also, unfortunately this is for intranet with the intention of accessing web app elsewhere internally; so i don't have a public url to give you for debugging.
Comment #9
MarcElbichon commentedCan you try with this version ? D7 ONLY !!!!
In the filter add crossdomain=true (ie: [[[myexternalurl.domain.com crossdomain=true]]]).
You need to copy insertFrame.js and jquery.ba-postmessage.js in your target site and insert them plus this code in ANY page that can by viewed in the iframe :
where allowedsites is an array of regexp for allowed host or domain. You can set ".*" or '.mydomain.com' or 'www.example.com' .
Comment #10
MarcElbichon commentedComment #11
MarcElbichon commentedNew version
Comment #12
MarcElbichon commentedI 've open a new issue for this.
#2087745: Crossdomain feature