Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Add permission to open popups to the editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Apr 12, 2012
1 parent 19b04cc commit 6e65e9d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.js
Expand Up @@ -10,15 +10,25 @@ var data = require("self").data
var PageMod = require("addon-kit/page-mod").PageMod
var protocol = require("raw.github.com/Gozala/jetpack-protocol/v0.3.0/index")
var fs = require("raw.github.com/Gozala/jetpack-io/v0.4.2/fs")
var permissions = require('./permissions')

const PROTOCOL = 'edit'
const editorURI = data.url('index.html')
const rootURI = editorURI.substr(0, editorURI.lastIndexOf('/') + 1)

console.log(editorURI)

function errorToJSON(error) {
return error ? { message: error.message, stack: error.stack } : error
}

// Allow popups for editor.
permissions.add({
host: 'edit:',
type: 'popup',
capability: true
})

var mod = PageMod({
include: PROTOCOL + ':*',
contentScript: 'unsafeWindow.port = self.port',
Expand Down

0 comments on commit 6e65e9d

Please sign in to comment.