Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function determineActiveURL(callback) {
- var b = window.URL || window.webkitURL,
- tabURL, parsedURL;
- chrome.tabs.query({
- active: true,
- windowId: chrome.windows.WINDOW_ID_CURRENT
- }, function(tabs) {
- if (!tabs || tabs.length == 0 || !tabs[0].url) {
- return;
- }
- tabURL = tabs[0].url;
- parsedURL = new window.URL(tabURL);
- if (parsedURL.hostname) {
- callback(parsedURL);
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement