From 218b5df8db37ea45e0f145a3400589a725a15658 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 4 Jan 2012 18:47:37 +0100 Subject: Manage rekonq pages in "current" NOT "main" frame Also double check for strange about urls BUG: 290411 --- src/newtabpage.cpp | 13 ++++++++----- src/protocolhandler.cpp | 4 ++-- src/protocolhandler.h | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp index 00c7f81d..a073117c 100644 --- a/src/newtabpage.cpp +++ b/src/newtabpage.cpp @@ -182,13 +182,16 @@ void NewTabPage::generate(const KUrl &url) } // webFrame can be null. See bug:282092 - if (!m_root.webFrame()) + QWebFrame *parentFrame = qobject_cast(parent()); + if (!parentFrame) + { + kDebug() << "NULL PARENT FRAME: PAGE NOT LOADED"; return; - WebPage *page = qobject_cast (m_root.webFrame()->page()); - page->mainFrame()->setHtml(m_html); - page->setIsOnRekonqPage(true); + } + + parentFrame->setHtml(m_html); - m_root = page->mainFrame()->documentElement().findFirst(QL1S("#content")); + m_root = parentFrame->documentElement().findFirst(QL1S("#content")); browsingMenu(url); diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp index ebb12e8f..9489f025 100644 --- a/src/protocolhandler.cpp +++ b/src/protocolhandler.cpp @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2010-2011 by Andrea Diamantini +* Copyright (C) 2010-2012 by Andrea Diamantini * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -136,7 +136,7 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra { QByteArray encodedUrl = _url.toEncoded(); // let webkit manage the about:blank url... - if (encodedUrl == QByteArray("about:blank")) + if (encodedUrl.startsWith(QByteArray("about:blank"))) { return false; } diff --git a/src/protocolhandler.h b/src/protocolhandler.h index a4ee61e4..80f37dfc 100644 --- a/src/protocolhandler.h +++ b/src/protocolhandler.h @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2010-2011 by Andrea Diamantini +* Copyright (C) 2010-2012 by Andrea Diamantini * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as -- cgit v1.2.1