Adding contextual menus to Steem Keychain

in #development9 months ago (edited)

View this post on Hive: Adding contextual menus to Steem Keychain

If, by now, you don't know about Steem Keychain then you need to wake up 😅. Steem Keychain (Keychain for short) is the Metamask for STEEM, its a browser extension that allows you to manage your private keys and sign transactions without passing your keys to the dApps. has integrated Keychain to allow you to login and use its feature without entering your password or private keys.

Context menus

I have previously contributed to the Keychain code and added a feature called Keychainify which allows overtaking a SteemConnect URL and trigger Keychain.

I've now added a new feature for displaying context menus to a page.

Transfer to user menus

Transfer to Steem user shortcut

When right-clicking on a link that sends you to a Steem user profile, you will see a "Steem Keychain" context menu allowing you to:

  • Transfer STEEM/SBD to the user
  • Send a MEMO message to the user (0.001 STEEM transfer)
  • Tip a user (1 STEEM transfer)

Transfer to author menus

Transfer to author
These context menus are the same as for the above but they are showing for a page as opposed to for links. So if you are on a page related to a Steem author (a blog post for example), then the menu will show up and will allow you to do the same thing as above

Technical challenges

I have developed several Chrome extensions with context menu before so it was easy, the challenge comes from understanding how Steem Keychain works and how to trigger a popup view. Thank you @stoodkev for being available and giving me some clues on where to look at.

I ended up having to refactor part of the navigation logic and move things around to make the popup screen show up and display the transfer view without temporarily showing the main view first and causing some flickering.

The feature is not yet available, a PR has been submitted:

Vote for my witness
Support @quochuy Witness.jpg
On Steem, Witnesses are playing the important role of providing a performant and safe network for all of us. You have the power to choose 30 trusty witnesses to package transactions and sign the blocks that will go in the Steem blockchain. Vote for me via SteemConnect to help me do more useful projects for the communities.


Mate, this is fantastic. So if I'm reading it right I could have a standing agreement with another Splinterlands player, that the winner of our matchups gets tipped SPT or DEC, then I can right click in the battle results window and send the booty directly without leaving
On second thought, clicking another player in that window just opens their splinterlands profile, not their steem account, so it wouldn't work. Still, great development. Appreciate your efforts :)

Hi @mattclarke, I have not tried with but if the URL to a user profile is similar to one to profile then it should work the same, I’m detecting based on a pattern that matches the path not the domain. I’m not sure how it would work with other coins though. Keychain v1.6 includes a partial version of the feature so you can try it now.

Posted using Partiko iOS

Yes, only Steem/SBD support currently. Also should'nt it be autopopulating the account name?
Right clicking on the username inside didn't return the option.

Yea, on the splinterland website, the usernames links are internal triggers instead of links to URLs. Would be tricker to support. I can have a look in the future.

The auto-populate is part of the pull request above, the feature was removed accidentally during the few first fixes.

This is awesome! I can see the possibilities of this extending even further into tribes and dapps. keychain has made my life so much easier and clearly will continue to do so. Great updates man, keep up the good work

Yes, this is an exploratory development, might give more ideas for future functionalities.

Posted using Partiko iOS

Hi, @quochuy!

You just got a 1.09% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Coin Marketplace

STEEM 0.22
TRX 0.02
BTC 11413.61
ETH 381.06
SBD 1.05