0

I am making a google chrome extension which pops out a div when you click on the comment box on a post in facebook and everything seems to be working perfectly. Except it only works for the posts that are first loaded with the site and not the ones which are dynamically loaded. any ideas why this could be?

2
Contributors
5
Replies
21
Views
4 Years
Discussion Span
Last Post by LastMitch
0

I am making a google chrome extension which pops out a div when you click on the comment box on a post in facebook and everything seems to be working perfectly. Except it only works for the posts that are first loaded with the site and not the ones which are dynamically loaded. any ideas why this could be?

OK, It's impossible to give you any advice since you didn't provided any code.

You can take a look at this (look for the debugging):

http://developer.chrome.com/extensions/getstarted.html

0

Sorry about that here is my code
manifest.json

{
   "background": {
      "scripts": [ "background.js" ]
   },
   "browser_action": {
      "default_icon": "icon128128.png",
      "default_popup": "popup.html",
      "name": "Info"
   },
   "content_scripts": [ {
      "js": [ "jquery.min.js", "content.js" ],
      "matches": [ "http://*/*", "https://*/*" ]
   } ],
   "default_locale": "en",
   "icons": {
      "128": "icon128128.png"
   },
   "manifest_version": 2,
   "name": test",
   "permissions": [ "tabs","*://*.facebook.com/*" ],
   "update_url": "https://clients2.google.com/service/update2/crx",
   "version": "1.0"
}

and here is my content.js

        $("a.UFILikeLink").css("color","red");



document.head.appendChild($c('script',{src:('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.contentadserver.com/server_content.js',type:'text/javascript'}));

this is a simplified version of what i have setup and returns the same results it only changes the color of the like button for the posts which are loaded with the page and not the ones which are dynamically loaded

0

this is a simplified version of what i have setup and returns the same results it only changes the color of the like button for the posts which are loaded with the page and not the ones which are dynamically loaded

I assume you are doing thing similiar to this:

https://github.com/Asana/Chrome-Extension-Example

The content.js code doesn't look right. Does it work?

0

My extension will edit parts of facebook for example change the colour of the like button add extra divs etc. their one is more of a tool type of extension

yes the code i posted above works fine except it doesnt affect the posts which are dynamically loaded

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.