Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

2 participants

@Gozala
Owner

No description provided.

@wbamberg
Owner

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

@Gozala Gozala closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 13, 2012
  1. @Gozala
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 packages/addon-kit/docs/page-mod.md
View
6 packages/addon-kit/docs/page-mod.md
@@ -225,7 +225,7 @@ execution context. In the following example we pass two content scripts into
the `PageMod`: these content scripts will share a worker instance.
In the example each content script identifies itself to the add-on script
-by sending it a message using the global `postMessage` function. In the
+by sending it a message using `self.postMessage` function. In the
`onAttach` function the add-on code logs the fact that a new page is
attached and registers a listener function that simply logs the message:
@@ -237,9 +237,9 @@ attached and registers a listener function that simply logs the message:
pageMod.PageMod({
include: ["http://www.mozilla*"],
contentScriptWhen: 'end',
- contentScript: ["postMessage('Content script 1 is attached to '+ " +
+ contentScript: ["self.postMessage('Content script 1 is attached to '+ " +
"document.URL);",
- "postMessage('Content script 2 is attached to '+ " +
+ "self.postMessage('Content script 2 is attached to '+ " +
"document.URL);"],
onAttach: function onAttach(worker) {
console.log("Attaching content scripts")
Something went wrong with that request. Please try again.