diff --git a/src/plugins/PyFalkon/CMakeLists.txt b/src/plugins/PyFalkon/CMakeLists.txt index dd44cae4c..55893e5c6 100644 --- a/src/plugins/PyFalkon/CMakeLists.txt +++ b/src/plugins/PyFalkon/CMakeLists.txt @@ -126,6 +126,8 @@ set(GENERATED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/wheelhelper_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/menu_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/action_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/urlinterceptor_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/extensionschemehandler_wrapper.cpp ) set(GENERATED_SOURCES_DEPENDENCIES ${GLOBAL_HEADER} @@ -148,6 +150,7 @@ foreach(INCLUDE_DIR ${PYSIDE_INCLUDE_DIR}) list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtNetwork") list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtWidgets") list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtWebChannel") + list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtWebEngineCore") list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtWebEngineWidgets") endforeach() diff --git a/src/plugins/PyFalkon/pyfalkon_global.h b/src/plugins/PyFalkon/pyfalkon_global.h index fded01ccf..b0d1983b1 100644 --- a/src/plugins/PyFalkon/pyfalkon_global.h +++ b/src/plugins/PyFalkon/pyfalkon_global.h @@ -62,8 +62,8 @@ // network #include "networkmanager.h" -//#include "urlinterceptor.h" -//#include "schemehandlers/extensionschemehandler.h" +#include "urlinterceptor.h" +#include "schemehandlers/extensionschemehandler.h" // notifications #include "desktopnotificationsfactory.h" diff --git a/src/plugins/PyFalkon/typesystem_pyfalkon.xml b/src/plugins/PyFalkon/typesystem_pyfalkon.xml index 449f84941..01388ecbc 100644 --- a/src/plugins/PyFalkon/typesystem_pyfalkon.xml +++ b/src/plugins/PyFalkon/typesystem_pyfalkon.xml @@ -1,5 +1,6 @@ + @@ -114,12 +115,10 @@ - diff --git a/src/scripts/hellopython/hellopython.py b/src/scripts/hellopython/hellopython.py index 1ab9f7cf0..77684d50d 100644 --- a/src/scripts/hellopython/hellopython.py +++ b/src/scripts/hellopython/hellopython.py @@ -35,6 +35,9 @@ class HelloPlugin(Falkon.PluginInterface, QtCore.QObject): self.sidebar = sidebar.HelloSidebar() Falkon.SideBarManager.addSidebar("hellopython-sidebar", self.sidebar) + self.schemeHandler = HelloSchemeHandler() + Falkon.MainApplication.instance().networkManager().registerExtensionSchemeHandler("hello", self.schemeHandler) + if state == Falkon.PluginInterface.LateInitState: for window in Falkon.MainApplication.instance().windows(): self.mainWindowCreated(window) @@ -105,3 +108,8 @@ class HelloPlugin(Falkon.PluginInterface, QtCore.QObject): del self.buttons[window] Falkon.registerPlugin(HelloPlugin()) + +class HelloSchemeHandler(Falkon.ExtensionSchemeHandler): + def requestStarted(self, job): + print("req {}".format(job.requestUrl())) + self.setReply(job, "text/html", "

TEST

{}".format(job.requestUrl()))