0

I've been working on a fairly specific problem with automation, described in this question

Note that I'm using python with Selenium WebDriver

I have since uncovered a maze of changes and problems ... suffice to say I'm attempting now to use Chromium and build an extension to deal with the authorisation prompt. The inspiration for this approach comes from here.

function callbackFn(details) {
  return {
      authCredentials: {
          username: "[insert_username_here]",
          password: "[insert_password_here]"
      }
  };
}

chrome.webRequest.onAuthRequired.addListener(
    callbackFn,
    {urls: ["<all_urls>"]},
    ['blocking']
);

Note the proxy parts are completely useless to me - I am interested in the listener and the callback function.

My intention is to use the same process as Mike used but with one very important change: I want to pass a json (or anything, really) with the username and password directly to the callback function. I am not particularly great with javascript so I accept that I could be missing something very obvious.

So how can one pass arbitrary values (in this case, 2 strings) to an extension at runtime using python and/or SeleniumWebdriver?

Thanks in advance!

Lex Woodfinger
  • 125
  • 1
  • 9

1 Answers1

0

There's one useful method I managed to find called Native Messaging. The chrome docs here go into it with some detail.

This is an answer to the question - how to pass arbitrary values to the JS in a chrome extension.


This is a better answer

Lex Woodfinger
  • 125
  • 1
  • 9