From: <asa...@us...> - 2017-05-05 17:40:14
|
Revision: 14376 http://sourceforge.net/p/htmlunit/code/14376 Author: asashour Date: 2017-05-05 17:40:11 +0000 (Fri, 05 May 2017) Log Message: ----------- - SgmlPage.getContentType - Document: implement .children, .embeds, .plugins, .contentType Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -390,4 +390,10 @@ final boolean entityReferenceExpansion) throws DOMException { return new DomNodeIterator((DomNode) root, whatToShow, filter, entityReferenceExpansion); } + + /** + * Returns the content type of this page. + * @return the content type of this page + */ + public abstract String getContentType(); } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -535,6 +535,14 @@ /** * {@inheritDoc} + */ + @Override + public String getContentType() { + return getWebResponse().getContentType(); + } + + /** + * {@inheritDoc} * Not yet implemented. */ @Override Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -33,8 +33,8 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; +import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCollection; -import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLinkElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLStyleElement; @@ -111,7 +111,7 @@ * * @param document the owning document */ - public StyleSheetList(final HTMLDocument document) { + public StyleSheetList(final Document document) { setParentScope(document); setPrototype(getPrototype(getClass())); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -24,6 +24,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ANCHORS_REQUIRES_NAME_OR_ID; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_CREATE_ELEMENT_STRICT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_DESIGN_MODE_INHERIT; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_SELECTION_RANGE_COUNT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_SETTING_DOMAIN_THROWS_FOR_ABOUT_BLANK; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_SET_LOCATION_EXECUTED_IN_ANCHOR; @@ -42,6 +43,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; @@ -73,8 +75,11 @@ import com.gargoylesoftware.htmlunit.html.HTMLParser; import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlApplet; +import com.gargoylesoftware.htmlunit.html.HtmlArea; import com.gargoylesoftware.htmlunit.html.HtmlAttributeChangeEvent; import com.gargoylesoftware.htmlunit.html.HtmlElement; +import com.gargoylesoftware.htmlunit.html.HtmlEmbed; +import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlImage; import com.gargoylesoftware.htmlunit.html.HtmlInput; import com.gargoylesoftware.htmlunit.html.HtmlPage; @@ -95,6 +100,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.Location; import com.gargoylesoftware.htmlunit.javascript.host.NativeFunctionPrefixResolver; import com.gargoylesoftware.htmlunit.javascript.host.Window; +import com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList; import com.gargoylesoftware.htmlunit.javascript.host.event.BeforeUnloadEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.CloseEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.CustomEvent; @@ -1760,15 +1766,144 @@ } /** - * Returns the value of the JavaScript property {@code forms}. - * @return the value of the JavaScript property {@code forms} + * Returns the value of the {@code forms} property. + * @return the value of the {@code forms} property */ @JsxGetter({CHROME, IE}) public Object getForms() { - return null; + return new HTMLCollection(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlForm && node.getPrefix() == null; + } + + @Override + public Object call(final Context cx, final Scriptable scope, + final Scriptable thisObj, final Object[] args) { + if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { + return super.call(cx, scope, thisObj, args); + } + throw Context.reportRuntimeError("TypeError: document.forms is not a function"); + } + }; } /** + * Returns the value of the {@code embeds} property. + * @return the value of the {@code embeds} property + */ + @JsxGetter({CHROME, IE}) + public Object getEmbeds() { + return new HTMLCollection(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlEmbed; + } + + @Override + public Object call(final Context cx, final Scriptable scope, + final Scriptable thisObj, final Object[] args) { + if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { + return super.call(cx, scope, thisObj, args); + } + throw Context.reportRuntimeError("TypeError: document.embeds is not a function"); + } + }; + } + + /** + * Returns the value of the {@code embeds} property. + * @return the value of the {@code embeds} property + */ + @JsxGetter({CHROME, IE}) + public Object getImages() { + return new HTMLCollection(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlImage; + } + + @Override + public Object call(final Context cx, final Scriptable scope, + final Scriptable thisObj, final Object[] args) { + if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { + return super.call(cx, scope, thisObj, args); + } + throw Context.reportRuntimeError("TypeError: document.images is not a function"); + } + }; + } + + /** + * Returns the value of the {@code scripts} property. + * @return the value of the {@code scripts} property + */ + @JsxGetter({CHROME, IE}) + public Object getScripts() { + return new HTMLCollection(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlScript; + } + + @Override + public Object call(final Context cx, final Scriptable scope, + final Scriptable thisObj, final Object[] args) { + if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { + return super.call(cx, scope, thisObj, args); + } + throw Context.reportRuntimeError("TypeError: document.scripts is not a function"); + } + }; + } + + /** + * Retrieves a collection of stylesheet objects representing the style sheets that correspond + * to each instance of a Link or + * {@link com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleDeclaration} object in the document. + * + * @return styleSheet collection + */ + @JsxGetter + public StyleSheetList getStyleSheets() { + return new StyleSheetList(this); + } + + /** + * Returns the value of the {@code plugins} property. + * @return the value of the {@code plugins} property + */ + @JsxGetter({CHROME, IE}) + public Object getPlugins() { + return getEmbeds(); + } + + /** + * Returns the value of the JavaScript property {@code links}. Refer also to the + * <a href="http://msdn.microsoft.com/en-us/library/ms537465.aspx">MSDN documentation</a>. + * @return the value of this property + */ + @JsxGetter + public Object getLinks() { + return new HTMLCollection(getDomNodeOrDie(), true) { + @Override + protected boolean isMatching(final DomNode node) { + return (node instanceof HtmlAnchor || node instanceof HtmlArea) + && ((HtmlElement) node).hasAttribute("href"); + } + + @Override + protected EffectOnCache getEffectOnCache(final HtmlAttributeChangeEvent event) { + final HtmlElement node = event.getHtmlElement(); + if ((node instanceof HtmlAnchor || node instanceof HtmlArea) && "href".equals(event.getName())) { + return EffectOnCache.RESET; + } + return EffectOnCache.NONE; + } + }; + } + + /** * Returns all the descendant elements with the specified class name. * @param className the name to search for * @return all the descendant elements with the specified class name @@ -1820,4 +1955,54 @@ public void setTitle(final String title) { } + /** + * Gets the children of the current node. + * @see <a href="http://msdn.microsoft.com/en-us/library/ms537446.aspx">MSDN documentation</a> + * @return the child at the given position + */ + @JsxGetter({CHROME, FF}) + public HTMLCollection getChildren() { + final DomNode node = getPage(); + final HTMLCollection collection = new HTMLCollection(node, false) { + @Override + protected List<DomNode> computeElements() { + final List<DomNode> children = new LinkedList<>(); + for (DomNode domNode : node.getChildNodes()) { + if (domNode instanceof DomElement) { + children.add(domNode); + } + } + return children; + } + }; + return collection; + } + + /** + * Returns the {@code contentType} property. + * @return the {@code contentType} property + */ + @JsxGetter({CHROME, FF}) + public String getContentType() { + return getPage().getContentType(); + } + + /** + * Returns the current selection. + * @return the current selection + */ + @JsxFunction(CHROME) + public Selection getSelection() { + return null; + } + + /** + * Returns this document's {@code head} element. + * @return this document's {@code head} element + */ + @JsxGetter({CHROME, IE}) + public Object getHead() { + return null; + } + } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -22,7 +22,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_GET_PREFERS_STANDARD_FUNCTIONS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_COLOR_EXPAND_ZERO; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_CREATE_ATTRUBUTE_LOWER_CASE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; @@ -52,9 +51,7 @@ import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.FrameWindow; -import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlApplet; -import com.gargoylesoftware.htmlunit.html.HtmlArea; import com.gargoylesoftware.htmlunit.html.HtmlAttributeChangeEvent; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlForm; @@ -73,7 +70,6 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.Window; -import com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList; import com.gargoylesoftware.htmlunit.javascript.host.dom.Attr; import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; import com.gargoylesoftware.htmlunit.javascript.host.dom.Selection; @@ -162,46 +158,34 @@ @Override @JsxGetter(FF) public Object getForms() { - return new HTMLCollection(getDomNodeOrDie(), false) { - @Override - protected boolean isMatching(final DomNode node) { - return node instanceof HtmlForm && node.getPrefix() == null; - } + return super.getForms(); + } - @Override - public Object call(final Context cx, final Scriptable scope, - final Scriptable thisObj, final Object[] args) { - if (getBrowserVersion().hasFeature(JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED)) { - return super.call(cx, scope, thisObj, args); - } - throw Context.reportRuntimeError("TypeError: document.forms is not a function"); - } - }; + /** + * {@inheritDoc} + */ + @Override + @JsxGetter(FF) + public Object getEmbeds() { + return super.getEmbeds(); } /** - * Returns the value of the JavaScript property {@code links}. Refer also to the - * <a href="http://msdn.microsoft.com/en-us/library/ms537465.aspx">MSDN documentation</a>. - * @return the value of this property + * {@inheritDoc} */ - @JsxGetter + @Override + @JsxGetter(FF) + public Object getPlugins() { + return super.getPlugins(); + } + + /** + * {@inheritDoc} + */ + @Override + @JsxGetter(FF) public Object getLinks() { - return new HTMLCollection(getDomNodeOrDie(), true) { - @Override - protected boolean isMatching(final DomNode node) { - return (node instanceof HtmlAnchor || node instanceof HtmlArea) - && ((HtmlElement) node).hasAttribute("href"); - } - - @Override - protected EffectOnCache getEffectOnCache(final HtmlAttributeChangeEvent event) { - final HtmlElement node = event.getHtmlElement(); - if ((node instanceof HtmlAnchor || node instanceof HtmlArea) && "href".equals(event.getName())) { - return EffectOnCache.RESET; - } - return EffectOnCache.NONE; - } - }; + return super.getLinks(); } /** @@ -570,17 +554,12 @@ } /** - * Returns the value of the {@code images} property. - * @return the value of the {@code images} property + * {@inheritDoc} */ - @JsxGetter + @Override + @JsxGetter(FF) public Object getImages() { - return new HTMLCollection(getDomNodeOrDie(), false) { - @Override - protected boolean isMatching(final DomNode node) { - return node instanceof HtmlImage; - } - }; + return super.getImages(); } /** @@ -883,9 +862,9 @@ } /** - * Returns this document's {@code head} element. - * @return this document's {@code head} element + * {@inheritDoc} */ + @Override @JsxGetter public HTMLElement getHead() { final HtmlElement head = getPage().getHead(); @@ -1087,17 +1066,12 @@ } /** - * Returns the value of the {@code scripts} property. - * @return the value of the {@code scripts} property + * {@inheritDoc} */ - @JsxGetter + @Override + @JsxGetter(FF) public Object getScripts() { - return new HTMLCollection(getDomNodeOrDie(), false) { - @Override - protected boolean isMatching(final DomNode node) { - return node instanceof HtmlScript; - } - }; + return super.getScripts(); } /** @@ -1111,18 +1085,6 @@ } /** - * Retrieves a collection of stylesheet objects representing the style sheets that correspond - * to each instance of a Link or - * {@link com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleDeclaration} object in the document. - * - * @return styleSheet collection - */ - @JsxGetter - public StyleSheetList getStyleSheets() { - return new StyleSheetList(this); - } - - /** * {@inheritDoc} */ @Override @@ -1206,9 +1168,9 @@ } /** - * Returns the current selection. - * @return the current selection + * {@inheritDoc} */ + @Override @JsxFunction public Selection getSelection() { return getWindow().getSelectionImpl(); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -370,6 +370,14 @@ * {@inheritDoc} */ @Override + public String getContentType() { + return "application/xml"; + } + + /** + * {@inheritDoc} + */ + @Override protected void setDocumentType(final DocumentType type) { super.setDocumentType(type); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentTest.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -2363,4 +2363,62 @@ verifyAlerts(driver, getExpectedAlerts()); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"1", "[object HTMLHtmlElement]"}, + IE = "not found") + public void children() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " if (document.children) {\n" + + " alert(document.children.length);\n" + + " alert(document.children.item(0));\n" + + " }\n" + + " else {\n" + + " alert('not found');\n" + + " }\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'></body>\n" + + "</html>"; + + final URL url = new URL(URL_FIRST, "abc%20def"); + expandExpectedAlertsVariables(url); + + final WebDriver driver = loadPage2(html, url); + verifyAlerts(driver, getExpectedAlerts()); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"application/xml", "text/html"}, + IE = {"undefined", "undefined"}) + public void contentType() throws Exception { + final String html = "<html>\n" + + "<head>\n" + + " <script>\n" + + " function test() {\n" + + " var xmlDocument = document.implementation.createDocument('', '', null);\n" + + " alert(xmlDocument.contentType);\n" + + " alert(document.contentType);\n" + + " }\n" + + " </script>\n" + + "</head>\n" + + "<body onload='test()'></body>\n" + + "</html>"; + + final URL url = new URL(URL_FIRST, "abc%20def"); + expandExpectedAlertsVariables(url); + + final WebDriver driver = loadPage2(html, url); + verifyAlerts(driver, getExpectedAlerts()); + } + } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java 2017-05-05 14:34:59 UTC (rev 14375) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java 2017-05-05 17:40:11 UTC (rev 14376) @@ -2552,10 +2552,84 @@ + " }\n" + "</script>\n" + "</head>\n" - + "<body onload='test()'><div/>" + + "<body onload='test()'>\n" + + " <div/>\n" + "</body></html>"; loadPageWithAlerts2(html); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "exception", + IE = "[object HTMLEmbedElement]") + public void embeds() throws Exception { + final String html = "" + + "<html><head>\n" + + "<script>\n" + + " function test() {\n" + + " try {\n" + + " alert(document.embeds(0));\n" + + " } catch(e) {alert('exception'); }\n" + + " }\n" + + "</script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + " <embed>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"1", "exception"}, + IE = {"1", "[object HTMLEmbedElement]"}) + public void plugins() throws Exception { + final String html = "" + + "<html><head>\n" + + "<script>\n" + + " function test() {\n" + + " try {\n" + + " alert(document.plugins.length);\n" + + " alert(document.plugins(0));\n" + + " } catch(e) {alert('exception'); }\n" + + " }\n" + + "</script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + " <embed>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "exception", + IE = "[object HTMLImageElement]") + public void images() throws Exception { + final String html = "" + + "<html><head>\n" + + "<script>\n" + + " function test() {\n" + + " try {\n" + + " alert(document.images(0));\n" + + " } catch(e) {alert('exception'); }\n" + + " }\n" + + "</script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + " <img>\n" + + "</body></html>"; + + loadPageWithAlerts2(html); + } + } |