JBrowser Source Docs
You are reading the documentation for JBrowser 1.4.1. The newest release is 1.5.4. Go to the latest documentation

jbrowser.services.downloads

Generated from the source code of JBrowser 1.4.1.

jbrowser/services/downloads.py · 306 lines

Download manager: accepts engine downloads, tracks progress, persists completed items.

Constants#

Name Value
DR QWebEngineDownloadRequest
DANGEROUS_EXTENSIONS {'.exe', '.msi', '.msix', '.msixbundle', '.appx', '.appxbundle', '.bat', '.cmd', '.com'…

DownloadRecord#

class DownloadRecordsource

Attributes

Name Value
url str
path str
filename str
total int = -1
received int = 0
state str = 'in_progress'
space_id str = ''
error str = ''
referrer str = ''
id str = field(default_factory=lambda: uuid.uuid4().hex[:12])
started float = field(default_factory=time.time)
finished float = 0.0

DownloadItem#

class DownloadItem(QObject)source
DownloadItem(record: DownloadRecord, request: DR | None=None, tab_id: str='', incognito: bool=False, parent: QObject | None=None)

Signals

Signal Arguments
changed (object)

DownloadItem.active#

property activesource

DownloadItem.paused#

property pausedsource

DownloadItem.fraction#

property fractionsource

DownloadItem.sample#

sample() -> Nonesource

DownloadManager#

class DownloadManager(QObject)source
DownloadManager(settings: Settings, store: Path, parent: QObject | None=None)

Signals

Signal Arguments
added (object)
updated (object)
removed (str)
activeCountChanged (int)
finished (object)

DownloadManager.items#

items() -> list[DownloadItem]source

DownloadManager.active_items#

active_items() -> list[DownloadItem]source

DownloadManager.overall_progress#

overall_progress() -> floatsource

DownloadManager.active_for_tab#

active_for_tab(tab_id: str) -> boolsource

DownloadManager.active_in_space#

active_in_space(space_id: str) -> boolsource

DownloadManager.default_directory#

default_directory() -> strsource

DownloadManager.handle#

handle(req: DR, space_id: str, incognito: bool) -> Nonesource

DownloadManager.pause#

pause(item: DownloadItem) -> Nonesource

DownloadManager.resume#

resume(item: DownloadItem) -> Nonesource

DownloadManager.cancel#

cancel(item: DownloadItem) -> Nonesource

DownloadManager.open#

static open(item: DownloadItem) -> Nonesource

DownloadManager.show_in_folder#

static show_in_folder(item: DownloadItem) -> Nonesource

DownloadManager.remove#

remove(item: DownloadItem) -> Nonesource

DownloadManager.clear_finished#

clear_finished() -> Nonesource

DownloadManager.save_now#

save_now() -> Nonesource

Functions#

is_dangerous_file#

is_dangerous_file(name: str) -> boolsource

write_mark_of_the_web#

write_mark_of_the_web(path: str, url: str, referrer: str, private: bool) -> boolsource

Tag a downloaded file as coming from the internet (Zone.Identifier alternate data stream), so Windows SmartScreen and Office Protected View treat it accordingly.