I have a chrome extension that adds a custom button beside the “like” button in facebook.
The problem is that when I launch facebook that button doesn’t appear and when I refresh the page it appears.
It’s a basic jQuery script:
$(".like_link").after("...MY BUTTON...");
I also tried to put an alert(“extension works”) function to see when the extension is loaded and when it doesn’t. So the problem is not of the button, it’s a problem of the extension itself.
I tried one more thing, I set the extension to work on all the websites (*://*.* in manifest.json). In all the websites it worked all the time, and in facebook I had to refresh every page after I launched it.
jQuery id LOADED into my extension. My manifest.json file:
{
"name": "Custom button",
"version": "0.1",
"description": "Add a custom button beside the like button!",
"content_scripts": [
{
"matches": ["*://facebook.com/*"], //or *://*/*
"css": ["style.css"],
"js": ["jquery-1.7.2.min.js","script.js"]
}
]
}
How about
"matches": ["*://*.facebook.com/*"](inserted asterisk beforefacebook.com)