Revision: 2923 http://archive-access.svn.sourceforge.net/archive-access/?rev=2923&view=rev Author: bradtofel Date: 2009-11-11 00:11:20 +0000 (Wed, 11 Nov 2009) Log Message: ----------- BUGFIX: now detects a frameset, and holds off inserting HTML content if found. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/rules/AfterBodyStartTagJSPExecRule.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/rules/AfterBodyStartTagJSPExecRule.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/rules/AfterBodyStartTagJSPExecRule.java 2009-11-11 00:09:47 UTC (rev 2922) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/rules/AfterBodyStartTagJSPExecRule.java 2009-11-11 00:11:20 UTC (rev 2923) @@ -52,6 +52,9 @@ * We also ensure we don't emit twice by storing a flag in the ParseContext once * we do emit. * + * Lastly, if we see a "FRAMESET" tag in the page, we hold off on inserting + * our content. + * * @author brad * */ @@ -60,6 +63,7 @@ private final String[] okHeadTags = { "HTML","HEAD","BASE","LINK","META","TITLE","STYLE","SCRIPT","BODY" }; + private final static String FRAMESET_TAG = "FRAMESET"; private final static String FERRET_DONE_KEY = AfterBodyStartTagJSPExecRule.class.toString(); public void visit(ReplayParseEventDelegator rules) { @@ -105,8 +109,13 @@ } else { // must be PHASE_PRE_MODIFY: if it's a body tag, emit now: if(isNotTagAppearingInHead(node)) { - // and this is a tag that shouldn't be in the HEAD. Emit: - emit((ReplayParseContext) context,node); + if(node.getTagName().equals(FRAMESET_TAG)) { + // don't put content in pages with a FRAMESET: + context.putData(FERRET_DONE_KEY,"1"); + } else { + // and this is a tag that shouldn't be in the HEAD. Emit: + emit((ReplayParseContext) context,node); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |