Readability/readability/__init__.py
2019-06-10 22:24:42 +02:00

31 lines
850 B
Python

import Falkon
from PySide2 import QtCore
class Readability(Falkon.PluginInterface, QtCore.QObject):
def init(self, state, settingsPath):
plugins = Falkon.MainApplication.instance().plugins()
plugins.mainWindowCreated.connect(self.onMainWindowCreated)
plugins.mainWindowDeleted.connect(self.mainWindowDeleted)
if state == Falkon.PluginInterface.LateInitState:
for window in Falkon.MainApplication.instance().windows():
self.onMainWindowCreated(window)
def unload(self):
for window in Falkon.MainApplication.instance().windows():
self.mainWindowDeleted(window)
def testPlugin(self):
return True
def onMainWindowCreated(self, window):
pass
def mainWindowDeleted(self, window):
pass
Falkon.registerPlugin(Readability())