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: Addressed comments Created March 13, 2015, 1:07 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
« no previous file with comments | « 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
@@ -45,17 +45,20 @@
window.addEventListener("message", loadHandler, false);
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)
{
« no previous file with comments | « ext/background.js ('k') | ext/devtools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld