0

I am encountering a strange error that I have not seen before while developing an extension for a client. After completing the extension (debugging,optimization, testing on several computers), the client's partner cannot get the extension to load on his computer. After basic trouble shooting, I have been incrementally sending him larger and larger subsections of the code to see what is preventing the code from executing properly. Initially I sent him basic code to make sure the popup would render with the libraries I am using (bootstrap, listjs, jquery), everything worked fine. Then I sent him code which uses message passing between the popup.js file and the background.js file, to log data to the background page's console. This is not working, and I am not sure why. It has worked fine on every other computer that I have tested with. I will attach the basic code below. I would like help identifying what could be causing the messaging to not work.

manifest.json

{
  "name": "Test E",
  "version": "1.0",
  "description": "Check background console",

 "background": {
    "page": "background.html"
  },

"browser_action": {
  "default_icon": {
       "19": "images/drop.png"
   },
   "default_popup": "popup.html"
},

"permissions": [
  "activeTab",
  "tabs"
 ],

 "manifest_version": 2
}

popup.js

$( document ).ready(function(){
gen_list();
  chrome.runtime.sendMessage({x:"work"});
});
function gen_list(){
  // this is just code to initialize the list from the list.js library 
  var options = {valueNames: ['name'],plugins: [ListFuzzySearch()]};
  var list1 = new List('hacker-list', options);
  list1.add( {name:"second"} );
  $( 'body' ).css('background-color',"green");
}

background.html

<html>
  <script src="js/bg.js"></script>
</html>

background.js

chrome.runtime.onMessage.addListener(function(m){
  console.log(m.x);
});
// this should log "work" to the console, it works perfectly fine on my computer

additional info: He has around 20 extensions loaded in the extension bar, he is running the latest version of chrome and is on osx el capitain.

kk.
  • 3,747
  • 12
  • 36
  • 67
nick
  • 1,197
  • 11
  • 16

0 Answers0