rickysarraf / foxreplace

Automatically exported from code.google.com/p/foxreplace
0 stars 0 forks source link

Named Anchor ('bookmark') fails in an Iframe #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Define a Named Anchor tag '<A name"Skip2here">' using Foxreplace
2.browse to http://server.com/thepage.html#Skip2here
3.browse to a page that has a <iframe> tag that points to 
http://server.com/thepage.html#Skip2here

What is the expected output? What do you see instead?

The Direct page browse works, it jumps to the Foxrepalce inserted <a> tag

The <iframe> tag however does not. Foxreplace in general does work on the 
<iframe>. Just not the internal 'bookmark' jump.

What version of the product are you using? On what operating system?

FoxReplace 0.12.2
FireFox 3.6.28
XP Sp3

Please provide any additional information below.

The Foxreplace entries must be applied to the affected page (not the <iframe> 
page) which is the correct way to do it, I'm just mentioning it for clarity.

Everything else (even my ad-in code from issue 75 ) works perfectly in the 
<iframe> that I've tried.

I'm currently getting around it by inserting javascript to completely rebuild 
the sub page into an order that show what I want in the <iframe> window, 
without scrolling down, but its a bit much.

I use the term 'bookmark' for a named anchor, as that was what they were called 
a long time ago (in the 90's) before the modern usage (saved page link). I 
don't think they have a newer name.

Original issue reported on code.google.com by mpheyse%...@gtempaccount.com on 30 Oct 2012 at 2:22

GoogleCodeExporter commented 9 years ago
Can you expand on the steps to reproduce the problem, especially regarding to 
the iframe part? Do you mean that the iframe is <iframe 
src="http://server.com/thepage.html#Skip2here"></iframe> or what?

Original comment by marc.r...@gmail.com on 31 Oct 2012 at 6:13

GoogleCodeExporter commented 9 years ago
Sure.

Fake page, and Server names. I can make up some actual page examples if that 
helps.

Make a replacement on a page "http://server.com/thepage.html" that adds a named 
a tag '<A name"Skip2here">'

Now if you browse to http://server.com/thepage.html#Skip2here  the page 
correctly will skip to that point

With that working Foxreplace setup unchanged, make a new page 'framedpage' that 
has an iframe entry (this is not using fox replace, just the page natively) 
'<iframe src="http://server.com/thepage.html#Skip2here"></iframe>'

The iframe page does not jump to the named anchor.  

If the named anchor is native  in 'thepage' (not added by foxreplace, but hard 
coded in) it does properly jump.

All other FoxReplacements do work on the iframe, and the Named anchor is 
present but isn't working.

I can make up a set of files if that would help

Original comment by mpheyse%...@gtempaccount.com on 31 Oct 2012 at 6:57

GoogleCodeExporter commented 9 years ago
Also its '<A name="Skip2here">', I missed the above '=' oops

Also some browsers support '<A id="Skip2here">' starting with HTML4 (as an 
internal bookmark -> #Skip2here) but 'name' is more universality accepted.

Original comment by mpheyse%...@gtempaccount.com on 31 Oct 2012 at 7:08

GoogleCodeExporter commented 9 years ago
Thanks, now the explanation it's clear.

I guess that this may be because the anchor is added after the iframe content 
is loaded, and then Firefox doesn't reprocess the content to search for the 
anchor. But it's just a guess.

It could be tested what is the behaviour if the anchor is added by a simple 
JavaScript code in the iframe content. Both with inline code

<script type="text/javascript">document.write('<a 
name="Skip2here">Skip2here</a>');</script>

and with code processed on body load

<body onload="functionThatInsertsTheAnchorSomewhere();">...

Original comment by marc.r...@gmail.com on 1 Nov 2012 at 12:58