[CRX] Fall back to sender.tab.url if !tab.url
sender.url is relatively new (Chromium 29) ( https://chromiumcodereview.appspot.com/14301016 )
This commit is contained in:
parent
520fdf2f6a
commit
aeaf11ca43
@ -96,10 +96,7 @@ limitations under the License.
|
|||||||
|
|
||||||
chrome.runtime.onMessage.addListener(function(message, sender) {
|
chrome.runtime.onMessage.addListener(function(message, sender) {
|
||||||
if (message === 'showPageAction' && sender.tab) {
|
if (message === 'showPageAction' && sender.tab) {
|
||||||
if (sender.tab.url === sender.url) {
|
showPageAction(sender.tab.id, sender.tab.url);
|
||||||
// Only respond to messages from the top-level frame
|
|
||||||
showPageAction(sender.tab.id, sender.url);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -145,7 +145,9 @@ var PDFHistory = {
|
|||||||
// window.history.pushState(stateObj, '');
|
// window.history.pushState(stateObj, '');
|
||||||
//#endif
|
//#endif
|
||||||
//#if CHROME
|
//#if CHROME
|
||||||
|
// if (top === window) {
|
||||||
// chrome.runtime.sendMessage('showPageAction');
|
// chrome.runtime.sendMessage('showPageAction');
|
||||||
|
// }
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1573,8 +1573,10 @@ var DocumentOutlineView = function documentOutlineView(outline) {
|
|||||||
// // Example: chrome-extension://.../http://example.com/file.pdf
|
// // Example: chrome-extension://.../http://example.com/file.pdf
|
||||||
// var humanReadableUrl = '/' + DEFAULT_URL + location.hash;
|
// var humanReadableUrl = '/' + DEFAULT_URL + location.hash;
|
||||||
// history.replaceState(history.state, '', humanReadableUrl);
|
// history.replaceState(history.state, '', humanReadableUrl);
|
||||||
|
// if (top === window) {
|
||||||
// chrome.runtime.sendMessage('showPageAction');
|
// chrome.runtime.sendMessage('showPageAction');
|
||||||
// }
|
// }
|
||||||
|
// }
|
||||||
//})();
|
//})();
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user