Form submission from local page

Hi,
I’m trying to port one of my add-ons from Chrome to Firefox. In order to POST data to new tab I use the next trick in Chrome:

  1. create local html file with empty FORM element.
  2. creating JS which parsing URL, extracting params and adding hidden inputs into the form.
  3. Opening new tab with my local file:
var url = chrome.runtime.getURL("post.html") + "?postData=" + encodeURIComponent(data);
chrome.tabs.create({url: url, active: true});

This trick works in Chrome, but not in FF. Server side script don’t see POST data.

I’ve tried to create basic HTML file with test form without any JS:

    <form method="post" accept-charset="UTF-8" action="http://mysite.com/post.php">
        <input name="foo" value="bar" type="text">
        <input type="submit">
    </form>

It is OK if I open it as local file in new tab and still don’t works if I open it from my extension with chrome.tabs.create.

Any ideas how to fix the problem or how to complete the task in another way?

I’m assuming you’re writing this with WebExtensions, not the Addons SDK or a legacy/XUL addon.

create local html file with empty FORM element.

You cannot write to the file system using WebExtensions (except by using download.download()).

Opening new tab with my local file:

You cannot open a tab with a local file as the contents, unless that file is already packaged within the addon itself.

Hi Eric,
thanks for the response.
The question was about fix/workaround for this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1344465. I found it a bit later. It seems that there is no workaround for it.