Chrome Storage – Username/Password

I’m having some problems with my chrome extension… I’m trying to save a username and password for auto-filling on another page – problem is it wont let me edit the username, although it fully works on password…

For clarification, brugernavn = username – adgangskode = password.

Popup window

The javascript activated through html popup is following:

Username:

  window.addEventListener('load', function load(event) {
      chrome.storage.local.get(['brugernavn'], function(result) {
          if (result !== undefined && result.brugernavn !== undefined) {
              document.getElementById('brugernavn').value = result.brugernavn;
    }
});

  document.getElementById('gem').onclick = function() {
    chrome.storage.local.remove('brugernavn');
      chrome.storage.local.set({'brugernavn': document.getElementById('brugernavn').value});
    };
});

Password:

  window.addEventListener('load', function load(event) {
      chrome.storage.local.get(['adgangskode'], function(result) {
          if (result !== undefined && result.adgangskode !== undefined) {
              document.getElementById('adgangskode').value = result.adgangskode;
          }
      });

  document.getElementById('gem').onclick = function() {
    chrome.storage.local.remove('adgangskode');
      chrome.storage.local.set({'adgangskode': document.getElementById('adgangskode').value});
};
  });

So password works fully, but I’m not able to edit username to save a new username.

Thanks in advance.

how to check what values are submitted by a form through devtool? [duplicate]

This question already has an answer here:

I want to test what values has been sent with the form after submitting a form.
Is there a way to check it from the chrome devtool or any other tool?

POST to new tab from Popup Script – Chrome Extension

I am trying to open a new tab on chrome and make a POST request to it, as soon as it opens. I have found this answer, which, as far as I understand, ‘is creating a form element with a content script and posting the form’. However, I am not sure if this is the best way to go for doing it from a popup script.

(Simplifying everything down), I have my popup.html like this:



And popup.js,

$('button').click(function() {
    // open a new tab and do a POST request
});

At this point, should I create a background script and do what Xan did here? Or did I have some misunderstanding what background can/cannot do? I am pretty confused on how to implement the “open a new tab and do form POST request” approach on a popup script.

Chrome extension – remove default text from forms using jQuery

I’m developing a Chrome extension, and I want to be able to insert saved data back into forms. In certain forms, some of the input elements will have default text. The problem I’m having is when I try to insert data into the form, the text retains the same class as if it was default text, and I want the text to appear as if a user entered it themselves. I tried triggering the ‘focus’ event for input elements with the following code:

$('form').find("input[type='text']").focus()

The code doesn’t work for my extension, but does work when I type it in the console. Any suggestions on how to get it to run?

Automate Filling Form Between Tabs In Chrome Extension

I want to take information that I receive in my gmail inbox and automatically copy it, open a new tab with my company’s other forms, and auto fill that form with the email info then automatically submit the form. I have to do hundreds of these a day, so I want to automate the whole process ideally. I can successfully capture all the values using jQuery, but I’m wondering how to open a lot of new tabs in chrome and auto fill all of the forms. Any thoughts are appreciated!