Ok so I'm trying a simple "Share On Facebook" page action... It's global, for any page, and clicking it should show the sharer window. Simple right? Well it's not working... The action just won't show up. What do I do? Here are the files:
manifest.jsonbackground.htmlCode:{ "name": "Share On Facebook", "version": "1.0", "description": "Share the current page with Facebook Share.", "background_page": "background.html", "page_actions": [ { "id": "facebookshare", "name": "Share this page on Facebook", "icons": ["facebook.png"] } ], "content_scripts": [ { "matches": ["http://*/*"], "js": ["share.js"] } ] }share.jsCode:<html> <head> <script type="text/javascript"> chrome.pageActions.enableForTab( "facebookshare", { tabId: -1, url: document.location.href } ); </script> </head> </html>I'm probably doing a million things wrong... But what are they? D:Code:function ShareOnFacebook() { var d=document, f='http://www.facebook.com/share', l=d.location,e=encodeURIComponent, p='.php?src=bm&v=4&i=1230248675&u='+e(l.href)+'&t='+e(d.title); 1; try { if (!/^(.*\.)?facebook\.[^.]*$/.test(l.host)) throw(0); share_internal_bookmarklet(p) } catch(z) { a=function() { if (!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=1,width=626,height=436,location=0'))l.href=f+p }; if (/Firefox/.test(navigator.userAgent)) setTimeout(a,0); else { a() } } void(0); }
I'll bet I'm getting the tab ID wrong, I saw -1 in the RSS reader example extension, but I think they had a function to decide the tab ID or something... How do I just enable it for all tabs?


LinkBack URL
About LinkBacks



Reply With Quote


