code: def closing_plugin(self, cancelable=False):
          
          self.save_history()
          self.set_option('zoom_factor',
                          self.pydocbrowser.webview.get_zoom_factor())
          return True
docs: Perform actions before parent main window is closed