Skip to content

Api functions

Kacper Fiedorowicz edited this page Oct 27, 2023 · 7 revisions

Tabs

-- Open new tab
rose.tab.new()

-- Close current tab
rose.tab.close()

-- Show next tab
rose.tab.next()

-- Show previous tab
rose.tab.prev()

Webview

-- Open
rose.webview.open()

-- Reload
rose.webview.reload()

-- Force Reload
rose.webview.force_reload()

-- Go Back
rose.webview.goback()

-- Go Forward
rose.webview.goforward()

-- Zoom Out
rose.webview.zoomout()

-- Zoom In
rose.webview.zoomin()

-- Load URI
rose.webview.load_uri()

-- Zoom Reset
rose.webview.zoom_reset()

-- Scroll to Bottom
rose.webview.scroll_to_bottom()

-- Scroll to Top
rose.webview.scroll_to_top()

-- Scroll Down
rose.webview.scroll_down()

-- Scroll Up
rose.webview.scroll_up()

-- Scroll Left
rose.webview.scroll_left()

-- Scroll Right
rose.webview.scroll_right()

-- Scroll Page Down
rose.webview.scroll_page_down()

-- Scroll Page Up
rose.webview.scroll_page_up()

-- Scroll Page Left
rose.webview.scroll_page_left()

-- Scroll Page Right
rose.webview.scroll_page_right()

-- Evaluate JavaScript
rose.webview.evaluate_javascript()

-- Run JavaScript
rose.webview.run_javascript()

Keymaps

--[[
In tools/ you can find tool named keyname, 
compile it to see what names of keys rose uses as alias.

Keymap string:
    - (modifier)-(keyname), for example "c-r" means control+r

Modifiers:
    - Control "c"
    - Shift "s"

Using control + shift + key:
    - "c-K"
]]

-- Set keymap
rose.keymap.set("c-equal", rose.webview.zoomin)

-- Delete keymap
rose.keymap.del("c-equal")

Window

-- Toggle fullscreen
rose.window.toggle.fullscreen()

-- Toggle minimize
rose.window.toggle.minimize()

-- Toggle maximize
rose.window.toggle.maximize()

-- Vertical split
rose.window.vsplit()

-- Horizontal split
rose.window.hsplit()

-- Close split
rose.window.split_close()
Clone this wiki locally