You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 3, 2024. It is now read-only.
At the moment any variables have to be explicitly passed during tab.run() and tab.wait(). However very often we would like to reuse the same value between multiple invocations of these methods.
We could do something simple as:
tabs.define({// perhaps also tab.define()username: 'foo',password: 'bla',findAuthFields: async()=>wait.selectorAll('input#username, input#password').amount(2),})awaittab.run(async()=>{awaitwait.documentComplete()const[usernameField,passwordField]=awaitfindAuthFields()awaitinteract.type(usernameField,[...username])awaitinteract.type(passwordField,[...password])})
If we restrict this so that:
define() only affects new invocations and not pending invocations
content scripts can not define()
serialization will occur immediately when define() is called
The implementation should be very simple, and the resulting API and its side-effects will be easy to understand for scripters.