[Pkg-mozext-commits] [perspectives-extension] 01/14: Bugfixes to make button correctly appear near URL bar and handle Firefox API change bug
David Prévot
taffit at moszumanska.debian.org
Sat Jun 20 21:28:45 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository perspectives-extension.
commit c78af60a327a1986f260bb39886531bcb0be9a8c
Author: Alexey Vesnin <serxis at gmail.com>
Date: Wed May 13 04:52:19 2015 +0300
Bugfixes to make button correctly appear near URL bar and handle Firefox API change bug
---
plugin/chrome/content/credits/contributors.txt | 3 ++-
plugin/chrome/content/initialize.xul | 32 ++++++++++++++++++++++++++
plugin/chrome/content/notaries.js | 3 +--
3 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/plugin/chrome/content/credits/contributors.txt b/plugin/chrome/content/credits/contributors.txt
index 0ae7f44..64f5c5f 100644
--- a/plugin/chrome/content/credits/contributors.txt
+++ b/plugin/chrome/content/credits/contributors.txt
@@ -9,4 +9,5 @@ Gerold Meisinger
Jens Mueller
Ramu Panayappan
Dave Schaefer
-Igor Velkov
\ No newline at end of file
+Igor Velkov
+Alexey Vesnin
diff --git a/plugin/chrome/content/initialize.xul b/plugin/chrome/content/initialize.xul
index fbe2c41..3eab959 100644
--- a/plugin/chrome/content/initialize.xul
+++ b/plugin/chrome/content/initialize.xul
@@ -39,6 +39,37 @@
}
}
+ // Thanks to Calomel SSL Validation plugin code
+ function addToolbarButton(toolbarId, buttonId, beforeId) {
+ Pers_debug.d_print("error","Inserting button " + buttonId + " into " + toolbarId + " before beforeId");
+ try {
+ var firefoxnav = document.getElementById(toolbarId);
+ var curSet = firefoxnav.currentSet;
+ var re = new RegExp(beforeId);
+ if (curSet.indexOf(buttonId) == -1)
+ {
+ var set;
+ // Place the button before the urlbar
+ if (curSet.indexOf(beforeId) != -1){
+ set = curSet.replace(re, buttonId + "," + beforeId);
+ Pers_debug.d_print("error", "inserting with RegEx");
+ } else { // at the end
+ set = curSet + "," + buttonId;
+ Pers_debug.d_print("error", "inserting at the end");
+ }
+ firefoxnav.setAttribute("currentset", set);
+ firefoxnav.currentSet = set;
+ document.persist(toolbarId, "currentset");
+ // If you don't do the following call, funny things happen
+ try {
+ BrowserToolboxCustomizeDone(true);
+ }
+ catch (e) { }
+ }
+ }
+ catch(e) { }
+ }
+/* old non-working version
function addToolbarButton(toolbarId, buttonId, beforeId) {
if(!buttonId) {
Pers_debug.d_print("error",
@@ -112,6 +143,7 @@
+ toolbarId + " doesn't exist");
}
}
+*/
</script>
</overlay>
diff --git a/plugin/chrome/content/notaries.js b/plugin/chrome/content/notaries.js
index 054c290..13de5a3 100644
--- a/plugin/chrome/content/notaries.js
+++ b/plugin/chrome/content/notaries.js
@@ -1029,8 +1029,7 @@ var Perspectives = {
}
Pers_debug.d_print("main", Perspectives.notaries);
Pers_statusbar.setStatus(null, Pers_statusbar.STATE_NEUT, "");
- getBrowser().addProgressListener(Perspectives.notaryListener,
- Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
+ getBrowser().addProgressListener(Perspectives.notaryListener);// , Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT); <-- addressing bug https://bugzilla.mozilla.org/show_bug.cgi?id=608628
setTimeout(function() { Perspectives.requeryAllTabs(gBrowser); }, 4000);
Pers_debug.d_print("main", "Perspectives Finished Initialization\n\n");
} catch(e) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/perspectives-extension.git
More information about the Pkg-mozext-commits
mailing list