forked from midori-browser/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for cross-browser Web Extension API
* Json-GLib is a introduced as a new dependency to read manifest.json * The README contains a new section to summarize the Web Extension API * Web extension support is implemented as a Peas plugin * Web extensions can be built-in, system-wide or user-installed * The Javascript interface is added to the core GLib.Resource * Midori.Tab shares a WebKit.UserContentManager per WebKit.WebContext Fixes: midori-browser#244
- Loading branch information
Showing
12 changed files
with
468 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Promise-based message handler | ||
var promises = []; | ||
var last_promise = 0; | ||
var m = function (fn, args, cb) { | ||
var promise = new Promise (function (resolve, reject) { | ||
window.webkit.messageHandlers.midori.postMessage ({fn: fn, args: args, promise: last_promise}); | ||
last_promise = promises.push({resolve: resolve, reject: reject}); | ||
}); | ||
return promise; | ||
} | ||
|
||
// Browser API | ||
window.browser = { | ||
tabs: { | ||
create: function (args, cb) { return m ('tabs.create', args, cb); }, | ||
executeScript: function (args, cb) { return m ('tabs.executeScript', args, cb); }, | ||
}, | ||
notifications: { | ||
create: function (args, cb) { return m ('notifications.create', args, cb); }, | ||
} | ||
} | ||
|
||
// Compatibility with Chrome | ||
window.chrome = window.browser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[Plugin] | ||
Module=web-extensions | ||
IAge=3 | ||
Builtin=true | ||
Name=Web Extensions |
Oops, something went wrong.