My Mozilla Addon (coded with the Addon SDK) needs to encrypt information in a webpage form before the form submits to the webpage's servers. The encryption library I use is only accessible in lib/main.js
and the information to be encrypted on the webpage is gathered by a content script.
My idea was to have my Addon encrypt the data with the following process:
main.js
. main.js
encrypts the data using a library, then sends the cipher text back to the content script. main.js
into the form, which then submits to the webpage's servers. Can I perform synchronous communication between the Addon's main code and the content script such that I can encrypt the form data after the submit button is clicked, but before the form submits the data to the servers? If not, can I halt the form's submission until I have encrypted the data, then manually prompt the form to submit with my newly encrypted input?
Any help in resolving this problem is much appreciated.
I think these links will help you
"Communicating using "port"
"Communicating With Other Scripts"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.