Permalink
Browse files

Firefox 4 Beta対応。

  • Loading branch information...
1 parent 7328ce0 commit 483fe58a127393ada4efb6094db119294f8e0e19 @nanto nanto committed Dec 29, 2010
View
5 chrome/content/autoloader.js
@@ -5,6 +5,7 @@ Components.utils.import("resource://hatenabar/modules/00-core.js", hatenabar);
if (!('autoload' in hatenabar) || hatenabar.autoload) {
hatenabar.loadModules();
- hatenabar.loadForURI("chrome://hatenabar/content/common/");
- hatenabar.loadForWindow(window);
+ let createObject = function () ({});
+ hatenabar.loadForURI("chrome://hatenabar/content/common/", createObject);
+ hatenabar.loadForWindow(window, createObject);
}
View
2 chrome/content/hatenabar/01-browser-utils.js
@@ -4,7 +4,7 @@
*/
if (nowDebug) {
- Application.console.open();
+ toErrorConsole();
}
View
5 install.rdf
@@ -4,8 +4,9 @@
<rdf:Description rdf:about="urn:mozilla:install-manifest">
<em:id>{03be6b1a-4501-4b15-b4eb-a0c623136b4a}</em:id>
<em:name>Hatena Toolbar</em:name>
- <em:version>1.0</em:version>
+ <em:version>1.0.1a1</em:version>
<em:type>2</em:type>
+ <em:unpack>true</em:unpack>
<em:optionsURL>chrome://hatenabar/content/preferences.xul</em:optionsURL>
<em:iconURL>chrome://hatenabar/skin/hatena-32x32.png</em:iconURL>
@@ -34,7 +35,7 @@
<rdf:Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.0</em:minVersion>
- <em:maxVersion>3.7a5pre</em:maxVersion>
+ <em:maxVersion>4.0b9</em:maxVersion>
</rdf:Description>
</em:targetApplication>
</rdf:Description>
View
13 resources/modules/00-core.js
@@ -528,10 +528,9 @@ let _loaderHelper = {
return this.unique(scripts);
},
- loadScripts: function lh_loadScripts(scripts, target) {
- let global = getGlobalObject(target);
+ loadScripts: function lh_loadScripts(scripts, target, createObject) {
scripts.forEach(function (script) {
- let env = new global.Object();
+ let env = createObject();
env.__proto__ = target;
loadSubScript(script, env);
if (env.EXPORT)
@@ -566,15 +565,15 @@ function loadPrecedingModules() {
}
/* This should be called from chrome pages. */
-function loadForURI(uri) {
+function loadForURI(uri, createObject) {
let scripts = _loaderHelper.getScriptsForURI(uri);
- _loaderHelper.loadScripts(scripts, this);
+ _loaderHelper.loadScripts(scripts, this, createObject);
}
/* This should be called from chrome pages. */
-function loadForWindow(win) {
+function loadForWindow(win, createObject) {
let scripts = _loaderHelper.getScriptsForWindow(win);
- _loaderHelper.loadScripts(scripts, this);
+ _loaderHelper.loadScripts(scripts, this, createObject);
}
/*
View
2 resources/modules/03-Prefs.js
@@ -1,5 +1,5 @@
Components.utils.import('resource://hatenabar/modules/00-core.js');
-loadPrecedingModules();
+loadPrecedingModules.call(this);
const EXPORTED_SYMBOLS = ['Prefs'];
View
2 resources/modules/04-Timer.js
@@ -1,5 +1,5 @@
Components.utils.import('resource://hatenabar/modules/00-core.js');
-loadPrecedingModules();
+loadPrecedingModules.call(this);
const EXPORTED_SYMBOLS = ['Timer'];
View
2 resources/modules/09-Migration.js
@@ -1,5 +1,5 @@
Components.utils.import('resource://hatenabar/modules/00-core.js');
-loadPrecedingModules();
+loadPrecedingModules.call(this);
const EXPORTED_SYMBOLS = ['Migration'];
View
2 resources/modules/10-HatenaLink.js
@@ -1,5 +1,5 @@
Components.utils.import('resource://hatenabar/modules/00-core.js');
-loadPrecedingModules();
+loadPrecedingModules.call(this);
EventService.createListener('AllModulesLoaded', bind(function () {
Cu.import('resource://' + EXTENSION_HOST + '/modules/11-User.js', this);
}, this));
View
2 resources/modules/11-User.js
@@ -1,5 +1,5 @@
Components.utils.import('resource://hatenabar/modules/00-core.js');
-loadPrecedingModules();
+loadPrecedingModules.call(this);
EventService.createListener('AllModulesLoaded', method(this, 'loadModules'));
const EXPORTED_SYMBOLS = ["User"];
View
2 resources/modules/12-HTTPConnection.js
@@ -1,5 +1,5 @@
Components.utils.import('resource://hatenabar/modules/00-core.js');
-loadPrecedingModules();
+loadPrecedingModules.call(this);
const EXPORTED_SYMBOLS = ['HTTPConnection', 'http'];
View
2 resources/modules/20-ExpireCache.js
@@ -1,5 +1,5 @@
Components.utils.import('resource://hatenabar/modules/00-core.js');
-loadPrecedingModules();
+loadPrecedingModules.call(this);
const EXPORTED_SYMBOLS = ['ExpireCache', 'HTTPCache'];
View
2 resources/modules/21-Account.js
@@ -1,5 +1,5 @@
Components.utils.import('resource://hatenabar/modules/00-core.js');
-loadPrecedingModules();
+loadPrecedingModules.call(this);
const EXPORTED_SYMBOLS = ['Account'];

0 comments on commit 483fe58

Please sign in to comment.