Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Bug 791026 Update examples to use `self.postMessage` #573

Closed
wants to merge 1 commit into from

2 participants

Irakli Gozalishvili wbamberg
Irakli Gozalishvili
Collaborator

No description provided.

wbamberg
Collaborator

This should also update the reference to the global onMessage at line 198, I think.

Irakli Gozalishvili Gozala closed this November 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 13, 2012
Irakli Gozalishvili Update examples to use `self.postMessage` instead of deprecated `post…
…Message` global.
f691947
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  packages/addon-kit/docs/page-mod.md
6  packages/addon-kit/docs/page-mod.md
Source Rendered
@@ -225,7 +225,7 @@ execution context. In the following example we pass two content scripts into
225 225
 the `PageMod`: these content scripts will share a worker instance.
226 226
 
227 227
 In the example each content script identifies itself to the add-on script
228  
-by sending it a message using the global `postMessage` function. In the
  228
+by sending it a message using `self.postMessage` function. In the
229 229
 `onAttach` function the add-on code logs the fact that a new page is
230 230
 attached and registers a listener function that simply logs the message:
231 231
 
@@ -237,9 +237,9 @@ attached and registers a listener function that simply logs the message:
237 237
     pageMod.PageMod({
238 238
       include: ["http://www.mozilla*"],
239 239
       contentScriptWhen: 'end',
240  
-      contentScript: ["postMessage('Content script 1 is attached to '+ " +
  240
+      contentScript: ["self.postMessage('Content script 1 is attached to '+ " +
241 241
                       "document.URL);",
242  
-                      "postMessage('Content script 2 is attached to '+ " +
  242
+                      "self.postMessage('Content script 2 is attached to '+ " +
243 243
                       "document.URL);"],
244 244
       onAttach: function onAttach(worker) {
245 245
         console.log("Attaching content scripts")
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.