The owner, on the v0.1.2442 sheet: the extension was written to ~/.config/magpie/browser-extension, a hidden folder no one can find to choose in Load unpacked. - Set up writes it to "Magpie Browser Extension" in the home folder (browserExtDir), where Finder and Explorer show it, and shows it selected in its parent (open -R on the Mac, explorer /select, on Windows, the home folder on Linux) rather than opened, to drag from. - On the Mac the sheet has the folder itself: a press on it that moves hands the folder to the system's drag (POST /api/library/browser/drag, filedrag_darwin.go: beginDraggingSession from the key window with a file URL and the folder's icon, only while the button is still down), so it drops onto chrome://extensions as from Finder. Chromium's extensions page loads a dropped folder as unpacked (drag_and_drop_handler.ts: entry.isDirectory -> loadUnpackedFromDrag), with Developer mode on, which step 2 asks for. - Elsewhere step 3 says to drag the folder from the window that opened, or Load unpacked and choose it. - Old installs: a browser that loaded the hidden folder still does, and that folder is kept up to date as long as it has a manifest; the sheet offers set up again, into the new folder. Run atace58117aon mote: go vet ./internal/gui (darwin), GOOS=linux -tags nogui and GOOS=windows vet; library-browser-setup and i18n-keys GUI tests, 46 of 46 (5 languages, Chromium and WebKit, 1100 and 420 wide, with and without the drag: a click posts no drag, a press that moves posts one); internal/cli parity tests ok. Atdf0320156: go test ./internal/gui ./internal/cli, cli ok, gui red only in TestMainWindowCorners, which is #3949 and red the same atdf0320156without this change. Not tried: the native drag by hand into a real Chrome (no way to drive a mouse drag here), and Explorer's /select on the Windows box.
16 lines
360 B
Go
16 lines
360 B
Go
//go:build !nogui
|
|
|
|
package gui
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/wailsapp/wails/v3/pkg/application"
|
|
)
|
|
|
|
// revealFolder shows the folder's parent, the folder in it to drag from
|
|
// there: file managers differ in how one is asked to select an item.
|
|
func revealFolder(app *application.App, path string) error {
|
|
return openFolder(app, filepath.Dir(path))
|
|
}
|