Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/content.js

Issue 5646124035604480: Issue 154 - Added UI for devtools panel on Chrome (Closed)
Patch Set: Rebased and adapted for API changes Created March 12, 2015, 4:08 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« devtools-panel.js ('K') | « ext/background.js ('k') | ext/devtools.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/content.js
===================================================================
--- a/ext/content.js
+++ b/ext/content.js
@@ -44,18 +44,22 @@
}
window.addEventListener("message", loadHandler, false);
+
Thomas Greiner 2015/03/13 11:11:05 That extra line is not really adding any value.
Sebastian Noack 2015/03/13 13:07:38 Done.
global.ext.backgroundPage = {
+ _sendRawMessage: function(message)
+ {
+ if (messageQueue)
+ messageQueue.push(message);
+ else
+ backgroundFrame.contentWindow.postMessage(message, "*");
+ },
sendMessage: function(message, responseCallback)
{
- var rawMessage = {
+ this._sendRawMessage({
type: "message",
messageId: ++maxMessageId,
payload: message
- };
- if (messageQueue)
- messageQueue.push(rawMessage);
- else
- backgroundFrame.contentWindow.postMessage(rawMessage, "*");
+ });
if (responseCallback)
{
« devtools-panel.js ('K') | « ext/background.js ('k') | ext/devtools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld