diff --git a/frontend/device/pocketbook/device.lua b/frontend/device/pocketbook/device.lua index fdb5717c4931..7ccaa758559f 100644 --- a/frontend/device/pocketbook/device.lua +++ b/frontend/device/pocketbook/device.lua @@ -428,6 +428,27 @@ function PocketBook:setEventHandlers(uimgr) end end +local function getBrowser() + if util.pathExists("/usr/bin/browser.app") then + return true, "/usr/bin/browser.app" + elseif util.pathExists("/ebrmain/bin/browser.app") then + return true, "/ebrmain/bin/browser.app" + end + return false +end + +function PocketBook:canOpenLink() + return inkview.MultitaskingSupported() and getBrowser() +end + +function PocketBook:openLink(link) + local found, bin = getBrowser() + if not found or not link or type(link) ~= "string" then return end + + local argv = ffi.new("const char *[1]", {link}) + inkview.OpenBook2(bin, 1, argv, 0) +end + -- Pocketbook HW rotation modes start from landsape, CCW local function landscape_ccw() return { 1, 0, 3, 2, -- PORTRAIT, LANDSCAPE, PORTRAIT_180, LANDSCAPE_180