Giter VIP home page Giter VIP logo

Comments (4)

tuxor1337 avatar tuxor1337 commented on May 25, 2024

It's a good idea to support entry-specific input names for certain fields. Implementation-wise this would be easiest like this:

AephieryZ2Ya
login: kevin
url: example.com
otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example
pin: 1234
loginkey: PASSFF_INPUT_OTP
fancyinput: PASSFF_INPUT_LOGIN

Then, if the user tells PassFF to fill the form, it would loop through the "other" fields like it's currently implemented:

passff/src/modules/page.js

Lines 257 to 261 in 2f3fb44

let matching = findIntersection(otherNames, inputNames);
if (matching !== undefined) {
writeValueWithEvents(input, passwordData._other[matching]);
return;
}

But if it finds that the value passwordData._other[matching] is a certain keyword like PASSFF_INPUT_LOGIN it would fill the value stored in the login field, and if the value is the keyword PASSFF_INPUT_OTP it would fill the otp token that has just been generated (currently, an otp token is generated regardless of the existence of a matching input element on the current web page):

 let matching = findIntersection(otherNames, inputNames); 
 if (matching !== undefined) { 
   let value = passwordData._other[matching];
   if (value == "PASSFF_INPUT_OTP") {
     value = passwordData.otp;
   } else if (value == "PASSFF_INPUT_LOGIN") {
     value = passwordData.login;
   } else if (value == "PASSFF_INPUT_PASSWORD") {
     value = passwordData.password;
   }
   writeValueWithEvents(input, value); 
   return; 
 } 

from passff.

madduck avatar madduck commented on May 25, 2024

This looks great, and while my initial thought was to reuse YAML references, let's not overcomplicate things, especially since we're not using YAML.

The only thing I'll say is s/INPUT/FIELD/ since we're not really talking input, but fields. But either way, this would be great to have, and I'll be the first to test.

from passff.

tuxor1337 avatar tuxor1337 commented on May 25, 2024

Either of INPUT or FIELD in the flag name is okay with me. The field name is both the name of a field and of an input. The flag then tells you that the corresponding "input" is actually to be used for a different purpose (like OTP or LOGIN), and it also tells you at the same time to use the value stored in a different "field" (like OTP or LOGIN).

from passff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.