2

Working on an add-on code that includes parameter passing between the add-on scripts and content script.But on execution of content script i am getting the Out of memory error. The code for content script is

var id = document.getElementById("usermail");
var pass = document.getElementById("password");
var values;

function loginClk() { //function called on click of login button
    values  = '{ "employees" : [' +'{ "firstName":'+id.value+' , "lastName":'+pass.value+' } ]}';
    getFirstPara();
};

self.port.on("get-first-para", getFirstPara);

function getFirstPara() { // function for communication with add-on script
    var firstPara = values;
    alert(firstPara);
    firstPara ="hello";
    self.port.emit("first-para", firstPara);
}

Would be great if someone could help me out in finding the error that results in out of memory error.

OshoParth
  • 1,492
  • 2
  • 20
  • 44
  • 1
    That means you've gone into a infinite loop. – Mouser Aug 10 '15 at 10:32
  • @Mouser please suggest some way to prevent this because if i execute this without calling getFirstPara() in loginClk() i do not get the value of "Values" Variable in getFirstPara(). – OshoParth Aug 10 '15 at 10:35
  • You have a lot of addon sdk questions and there arent too my of those devs answer questions so thanks for your patience and persistence. Ill try to look at this and answer. – Noitidart Aug 11 '15 at 07:41
  • @Noitidart Thanks Buddy :) .. Hope we seek contributor's attention soon to get the issues resolved. – OshoParth Aug 11 '15 at 07:56
  • You seem cool man and I saw your profile you are into C. You'll probably love js-ctypes, you can make some awesome addons with it. Jump on IRC if you want to chat about it. I'm interested to see what you are up to in this addon as well I miiiight be able to help, but the SDK is really far from my specialty. I'm on the moz irc channels irc://moznet/introduction or heres mibbit link: https://client00.chat.mibbit.com/?url=irc%3A%2F%2Firc.mozilla.org%2F%23introduction – Noitidart Aug 11 '15 at 08:01

0 Answers0