Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox addon how to remove the persisted data on open tab

  • 1 reply
  • 1 has this problem
  • 1 view
  • Last reply by philipp

more options

I and sending a request using tab Like this

var pageUrl = "sitedetails.html";
           
      tabs.on("ready", function(tab) 
      {       
       var worker = tab.attach({
        contentScriptFile: [self.data.url("jquery.min.js"),self.data.url("CallsClasses.js"),self.data.url("aes.js"),self.data.url("crypt/sha1.js"),self.data.url("crypt/pbkdf2.js"),self.data.url("sitedetails.js"),self.data.url("commonclasees.js")]
       });
       
       worker.port.emit('send_user_domain',userid,userdevicetoken,urlid,registersites,registerusers);
       worker.port.on('action',function(resp)
       {
        switch(resp.action)
        {
         case "update_domain":
          console.log("updated Domain Request"+JSON.stringify(resp.data));
          update_items("registered_sites","localtime_registered_sites",resp.data,resp.urlid,resp.user_id);
         break;
         case "registered_users":
          console.log("registered_users Domain Request"+JSON.stringify(resp.data));
          addItem("registered_users",resp.data);
         break;
         case "delete_domain":
          console.log("Deleted Domain Request"+JSON.stringify(resp.urlid));
          delete_items("registered_sites","localtime_registered_sites",resp.urlid,resp.user_id);
         break;
         case "update_user":
          console.log("updated update_user Request "+JSON.stringify(resp.data));
          update_items("registered_users","localtime_registered_users",resp.detailid,resp.user_id);
         break;
         case "delete_user":
          console.log("deleted delete_user Request "+JSON.stringify(resp.detailid));
          delete_items("registered_users","localtime_registered_users",resp.detailid,resp.user_id);
         break;
        }
        
       });
      });
      tabs.open(pageUrl); 

first time It shows Correct result. but on second time it goes for 2 requests . First is new one and second is old. As We open multiple tabs with same request. It goes for multiple request. What I want is to, whenever I open a new tab my old tab request should not be followed with new one

I and sending a request using tab Like this <pre><nowiki>var pageUrl = "sitedetails.html"; tabs.on("ready", function(tab) { var worker = tab.attach({ contentScriptFile: [self.data.url("jquery.min.js"),self.data.url("CallsClasses.js"),self.data.url("aes.js"),self.data.url("crypt/sha1.js"),self.data.url("crypt/pbkdf2.js"),self.data.url("sitedetails.js"),self.data.url("commonclasees.js")] }); worker.port.emit('send_user_domain',userid,userdevicetoken,urlid,registersites,registerusers); worker.port.on('action',function(resp) { switch(resp.action) { case "update_domain": console.log("updated Domain Request"+JSON.stringify(resp.data)); update_items("registered_sites","localtime_registered_sites",resp.data,resp.urlid,resp.user_id); break; case "registered_users": console.log("registered_users Domain Request"+JSON.stringify(resp.data)); addItem("registered_users",resp.data); break; case "delete_domain": console.log("Deleted Domain Request"+JSON.stringify(resp.urlid)); delete_items("registered_sites","localtime_registered_sites",resp.urlid,resp.user_id); break; case "update_user": console.log("updated update_user Request "+JSON.stringify(resp.data)); update_items("registered_users","localtime_registered_users",resp.detailid,resp.user_id); break; case "delete_user": console.log("deleted delete_user Request "+JSON.stringify(resp.detailid)); delete_items("registered_users","localtime_registered_users",resp.detailid,resp.user_id); break; } }); }); tabs.open(pageUrl); </nowiki></pre> first time It shows Correct result. but on second time it goes for 2 requests . First is new one and second is old. As We open multiple tabs with same request. It goes for multiple request. What I want is to, whenever I open a new tab my old tab request should not be followed with new one

Modified by cor-el

All Replies (1)

more options

hi sanjeet_singh, support.mozilla.org is intended for end-user support. please put your question to the mozilla addon forums where you will probably get better answers to all issues regrading extension development: https://discourse.mozilla-community.org/c/add-ons

Where to go for developer support