Unable to fire a post form request on FIrefox add-on


(Poc7667) #1

My extension is working fine in Chrome environment.
However, if I run it in the Firefox.
I will get the exception which disallows me to login into Salesforce directly through the POST form action.

The feature is trying to open a new tab and do the POST request to login on the new tab.

Any idea?

An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.

var form = document.createElement("form");
// To make lading page work, we need to use POST method
form.setAttribute("method", "post");
form.setAttribute("accept-charset", "utf-8");
form.setAttribute("action", loginUrl);
form.appendChild(setupUsername(username));
form.appendChild(setupPassword(password));
document.body.appendChild(form);
debugger
form.submit();

manifest.json

"omnibox": { "keyword" : "sf" },
"permissions": [
  "webRequest",
  "*://*/*",
  "tabs",
  "<all_urls>",
  "cookies",
  "storage",
  "unlimitedStorage",
  "https://login.salesforce.com/"
],