opera
The community/apps/opera
directory contains files that add support for the Opera web browser to Talon. This support is implemented through a combination of .py
files that define actions for the application, and a .talon
file that activates those actions in the correct context.
The opera.py
file defines the application matchers for Opera. These matchers are used by Talon to determine when the following actions should be activated. It specifies that the following actions should be active when the app name is "Opera" or "Opera Internet Browser" on all platforms, when the app bundle is com.operasoftware.Opera
on macOS, when the app executable matches opera.exe
on Windows, and when the app executable is opera
on Linux.
The opera.talon
file enables the browser
and user.tabs
tags when the active application is Opera. This allows the user to use browser navigation commands and tab-related commands when using Opera.
The opera_mac.py
file defines the actions specific to Opera on macOS. It defines a set of actions in the UserActions
class, such as tab_duplicate
, tab_final
, and tab_close_wrapper
. Additionally it defines some actions in the AppActions
class, specifically tab_next
and tab_previous
which use keyboard shortcuts for tab navigation. There are also some overridden BrowserActions
such as go_back
, go_forward
, show_downloads
, show_extensions
, show_history
, focus_page
and reload_hard
which call built-in Talon actions or call keyboard shortcuts. Note that some actions such as bookmark_tabs
and go_home
are not implemented.
The opera_win_linux.py
file defines the actions specific to Opera on Windows and Linux. Like the macOS version, it defines a set of actions in the UserActions
class, such as tab_duplicate
, tab_jump
, tab_final
, and tab_close_wrapper
. The AppActions
class includes actions for tab_next
and tab_previous
with platform specific keyboard shortcuts. It also overrides some BrowserActions
, such as go_back
, go_forward
, bookmarks
, show_downloads
, show_extensions
, focus_page
and reload_hard
. Note that some actions such as bookmarks_bar
, bookmark_tabs
and go_home
are not implemented.
The tab_duplicate
action in both opera_mac.py
and opera_win_linux.py
works by focusing the address bar, copying the URL, opening a new tab, pasting the URL, and pressing enter. This approach ensures that the current tab's URL is duplicated, even if it was manually edited in the address bar before the command was called.