From ee70453b6e43eeec42757830c03d54698abf48f9 Mon Sep 17 00:00:00 2001 From: moond4rk Date: Thu, 3 Dec 2020 11:47:00 +0800 Subject: [PATCH] feat: support opera for macOS Close #49 --- core/browser.go | 1 - core/browser_darwin.go | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/browser.go b/core/browser.go index 014db23..df37274 100644 --- a/core/browser.go +++ b/core/browser.go @@ -20,7 +20,6 @@ const ( braveName = "Brave" operaName = "Opera" operaGXName = "OperaGX" - vivaldiName = "vivaldi" ) type Browser interface { diff --git a/core/browser_darwin.go b/core/browser_darwin.go index f46347e..710d06e 100644 --- a/core/browser_darwin.go +++ b/core/browser_darwin.go @@ -15,6 +15,8 @@ const ( edgeProfilePath = "/Users/*/Library/Application Support/Microsoft Edge/*/" fireFoxProfilePath = "/Users/*/Library/Application Support/Firefox/Profiles/*.default-release/" braveProfilePath = "/Users/*/Library/Application Support/BraveSoftware/Brave-Browser/*/" + operaProfilePath = "/Users/*/Library/Application Support/com.operasoftware.Opera/" + operaGXProfilePath = "/Users/*/Library/Application Support/com.operasoftware.OperaGX/" ) const ( @@ -22,6 +24,7 @@ const ( chromeBetaStorageName = "Chrome" edgeStorageName = "Microsoft Edge" braveStorageName = "Brave" + operaStorageName = "Opera" ) var ( @@ -61,6 +64,18 @@ var ( Storage: chromeBetaStorageName, New: NewChromium, }, + "opera": { + ProfilePath: operaProfilePath, + Name: operaName, + Storage: operaStorageName, + New: NewChromium, + }, + "opera-gx": { + ProfilePath: operaGXProfilePath, + Name: operaGXName, + Storage: operaStorageName, + New: NewChromium, + }, } )