#81 Allow plugins to create custom placeholders for auto type


In my recent KeyOtp plugin I thought it would be nice to allow the auto type feature to put TOTP codes in. I noticed that there is an HOTP placeholder already and thought it would be a nice feature for plugins to have a provider pool that they could tap into to create custom placeholders. This is an experimental but workable version of this that I hacked together.

I would be willing to completely re-factor it as per your suggestions if you want it done differently. My goal is to add this feature without taking up too much of your time. I also realize it should probably have some safeguards to prevent adding placeholders that are built in as well as a standard mechanism for the provider to report back that it can't fulfill the requirement. I didn't polish it up too much since I wasn't even sure you'd go for it.

What are your thoughts? Is this even a feature that you would be willing to consider including if it were more developed?



  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-19

    Mercurial patch file(standard diff notation)

  • Dominik Reichl

    Dominik Reichl - 2012-08-19

    Plugins can already modify auto-type sequences (e.g. replace the placeholders that they provide) by subscribing to one of the following events and modifying the Sequence property string of the event object: AutoType.FilterCompilePre, AutoType.FilterSendPre, AutoType.FilterSend.

    Anyway, for a TOTP placeholder I don't think this is the right approach. The above events are meant to modify auto-type sequences, however your placeholder should also be replaced e.g. when copying a field (containing the placeholder) to the clipboard or using drag&drop.

    I've thus now added filter events for the Spr engine. You can subscribe to SprEngine.FilterCompile and modify the text as you wish (e.g. replace a TOTP placeholder provided by your plugin). Please read the 'Important notes for plugin developers' in the SprEngine.cs file.

    I'll send you the latest source code by e-mail.

    Best regards

  • Dominik Reichl

    Dominik Reichl - 2012-08-19
    • milestone: 353876 -->
    • status: open --> closed

Log in to post a comment.