Skip to content

Commit

Permalink
Change bookmarklet prefix to "bml"
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Jan 6, 2020
1 parent 09a7231 commit 5e768bd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion actions_custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func loadCustomActions() customActions {
log.Printf("invalid modifier for %q", key)
}

if strings.HasPrefix(name, "bkm:") {
if strings.HasPrefix(name, "bml:") {
kind = "bookmarklet"
parts := strings.SplitN(name[4:], ",", 2)
id, name = parts[0], parts[1]
Expand Down
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func runBookmarklets(_ []string) error {
wf.NewItem(bm.Title).
Subtitle("↩ to execute in current tab").
UID(bm.ID).
Copytext("bkm:"+bm.ID+","+bm.Title).
Copytext("bml:"+bm.ID+","+bm.Title).
Arg(bm.URL).
Icon(iconBookmarklet).
Valid(true).
Expand Down Expand Up @@ -359,7 +359,7 @@ func runActions(_ []string) error {
}
wf.NewItem(a.name).
UID(a.id).
Copytext("bkm:"+a.id+","+a.name).
Copytext("bml:"+a.id+","+a.name).
Icon(iconBookmarklet).
Valid(true).
Var("CMD", "run-bookmarklet").
Expand Down
4 changes: 2 additions & 2 deletions extension/alfred.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const HistoryEntry = hi => {

obj.id = hi.id || 0;
obj.url = hi.url || '';
obj.title = hi.title || '';
obj.title = hi.title || hi.url;

obj.toString = function() {
return `#${this.id} "${this.title}" - ${this.url}`;
Expand Down Expand Up @@ -363,7 +363,7 @@ const Background = function() {
return browser.history
.search({ text: query, startTime: 0 })
.then(items => {
let history = items.map(it => HistoryEntry(it));
let history = items.filter(it => it.url).map(it => HistoryEntry(it));
console.debug(`${history.length} history item(s) for "${query}"`);
return history;
});
Expand Down
6 changes: 3 additions & 3 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ variables={allvars}
<key>escaping</key>
<integer>102</integer>
<key>keyword</key>
<string>history</string>
<string>hist</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
Expand Down Expand Up @@ -952,9 +952,9 @@ variables={allvars}
<key>variables</key>
<dict>
<key>TAB_CTRL</key>
<string>bkm:seoxED9MBuqi,Add to Pinboard</string>
<string>bml:seoxED9MBuqi,Add to Pinboard</string>
<key>TAB_GODOC</key>
<string>bkm:uFJCA875bTEt,Open in GoDoc</string>
<string>bml:uFJCA875bTEt,Open in GoDoc</string>
<key>URL_DEFAULT</key>
<string>Open in Firefox</string>
<key>URL_OPT</key>
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ package main
// TODO: package extension
// TODO: chmod socket to secure it from other users
// TODO: move socket to /tmp/firefox.username.sock?
// BUG: Some history items don't have a title. Use URL instead.

import (
"bufio"
Expand Down

0 comments on commit 5e768bd

Please sign in to comment.