Problem: Facebook (and likely others) submit the form element without the URL as updated by the extension. Currently, this will post the clear text to Facebook, and when we have the secure posting form, it will try to post empty contents. We need to simulate a user typing or pasting into a form element when we create new Privly posts. This will cause host pages to look for updated content in the form element.
We should trigger key press events (keydown, keypress, keyup, change) on the form element receiving the Privly link. Currently, this functionality belongs in the success callbacks defined within extension-host-interface.js.
jQ.ajax({
data: { auth_token: privlyAuthentication.authToken,
"post[content]": value,
"post[public]": postPrivacySetting,
endpoint: "extension", browser: "firefox", version: "0.1.1.1"
},
type: "POST",
url: contentServerUrl + "/posts.json",
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
dataType: "json",
accepts: "json",
success: function (data, textStatus, jqXHR) {
target.value = jqXHR.getResponseHeader("privlyurl");
//
//
//trigger element change events here
//
//
}
});