@Override public Har newPage(String pageRef, String pageTitle) { if (har == null) { throw new IllegalStateException("No HAR exists for this proxy. Use newHar() to create a new HAR before calling newPage()."); } Har endOfPageHar = null; if (currentHarPage != null) { String currentPageRef = currentHarPage.getId(); // end the previous page, so that page-wide timings are populated endPage(); // the interface requires newPage() to return the Har as it was immediately after the previous page was ended. endOfPageHar = BrowserMobProxyUtil.copyHarThroughPageRef(har, currentPageRef); } if (pageRef == null) { pageRef = "Page " + harPageCount.getAndIncrement(); } if (pageTitle == null) { pageTitle = pageRef; } HarPage newPage = new HarPage(pageRef, pageTitle); har.getLog().addPage(newPage); currentHarPage = newPage; return endOfPageHar; }
logCopy.addPage(page);
@Override public Har newPage(String pageRef, String pageTitle) { if (har == null) { throw new IllegalStateException("No HAR exists for this proxy. Use newHar() to create a new HAR before calling newPage()."); } Har endOfPageHar = null; if (currentHarPage != null) { String currentPageRef = currentHarPage.getId(); // end the previous page, so that page-wide timings are populated endPage(); // the interface requires newPage() to return the Har as it was immediately after the previous page was ended. endOfPageHar = BrowserMobProxyUtil.copyHarThroughPageRef(har, currentPageRef); } if (pageRef == null) { pageRef = "Page " + harPageCount.getAndIncrement(); } if (pageTitle == null) { pageTitle = pageRef; } HarPage newPage = new HarPage(pageRef, pageTitle); har.getLog().addPage(newPage); currentHarPage = newPage; return endOfPageHar; }
@Override public Har newPage(String pageRef, String pageTitle) { if (har == null) { throw new IllegalStateException("No HAR exists for this proxy. Use newHar() to create a new HAR before calling newPage()."); } Har endOfPageHar = null; if (currentHarPage != null) { String currentPageRef = currentHarPage.getId(); // end the previous page, so that page-wide timings are populated endPage(); // the interface requires newPage() to return the Har as it was immediately after the previous page was ended. endOfPageHar = BrowserMobProxyUtil.copyHarThroughPageRef(har, currentPageRef); } if (pageRef == null) { pageRef = "Page " + harPageCount.getAndIncrement(); } if (pageTitle == null) { pageTitle = pageRef; } HarPage newPage = new HarPage(pageRef, pageTitle); har.getLog().addPage(newPage); currentHarPage = newPage; return endOfPageHar; }
@Override public Har newPage(String pageRef, String pageTitle) { if (har == null) { throw new IllegalStateException("No HAR exists for this proxy. Use newHar() to create a new HAR before calling newPage()."); } Har endOfPageHar = null; if (currentHarPage != null) { String currentPageRef = currentHarPage.getId(); // end the previous page, so that page-wide timings are populated endPage(); // the interface requires newPage() to return the Har as it was immediately after the previous page was ended. endOfPageHar = BrowserMobProxyUtil.copyHarThroughPageRef(har, currentPageRef); } if (pageRef == null) { pageRef = "Page " + harPageCount.getAndIncrement(); } if (pageTitle == null) { pageTitle = pageRef; } HarPage newPage = new HarPage(pageRef, pageTitle); har.getLog().addPage(newPage); currentHarPage = newPage; return endOfPageHar; }
logCopy.addPage(page);
logCopy.addPage(page);