Monday, 15 August 2011

google chrome extension - How to follow a redirect in Javascript? -


I am working on a Chrome extension that has a conditional reference menu. The menu should look like when you click OK with the name "youtube.com" as the host name on a link.

It works most of the time while using social media like Facebook or Twitter. Facebook and Twitter are internally redirected, so my code can not identify the URL, and thus does not display the context menu. My code looks like this:

  var contexts = ["selection", "frame", "page", "editable", "link", "video"]; Var Accepted URL = ["*: //*.youtube.com/*", "*: //youtube.com/*", "*: //*.soundcloud.com/*", "*: // sound cloud .com / * "]; Var title = "Add to queue"; Chrome.contextMenus.create ({"title": title, "references": references, "document surrender": approved URL});  

Is there a way to detect that a URL will redirect from within a Chrome extension?


No comments:

Post a Comment