Permalink
Browse files

Updates for Chrome 0.4.5 and Firefox 1.2.6

  • Loading branch information...
1 parent e6d2dec commit 2fee3009976512bbe5fbf0660844733cebd3e1bd @chrispederick committed Sep 13, 2013
@@ -1,3 +1,3 @@
common.prefix=
description=Adds a toolbar button with various web developer tools. The official port of the Web Developer extension for Firefox.
-version=0.4.4
+version=0.4.5
@@ -41,14 +41,14 @@
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:maxVersion>22.*</em:maxVersion>
+ <em:maxVersion>25.*</em:maxVersion>
<em:minVersion>3.6</em:minVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
- <em:maxVersion>2.17.*</em:maxVersion>
+ <em:maxVersion>2.20.*</em:maxVersion>
<em:minVersion>2.0</em:minVersion>
</Description>
</em:targetApplication>
@@ -34,6 +34,7 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><b class="caret"></b></a>
<ul class="dropdown-menu"></ul>
</li>
+ <li><a href="#" id="web-developer-reload"></a></li>
<li><a href="#" id="web-developer-collapse-all"></a></li>
<li><a href="#" id="web-developer-expand-all"></a></li>
</ul>
@@ -67,7 +67,7 @@ WebDeveloperApplication.prototype.getPostData = function()
try
{
var sessionHistory = getWebNavigation().sessionHistory;
- var entry = sessionHistory.getEntryAtIndex(sessionHistory.index, false).QueryInterface(Components.interfaces.nsISHEntry);
+ var entry = sessionHistory.getEntryAtIndex(sessionHistory.index, false).QueryInterface(Components.interfaces.nsISHEntry);
return entry.postData;
}
@@ -46,7 +46,7 @@ WebDeveloper.ElementInformation.initialize = function()
WebDeveloper.ElementAncestors.createToolbar();
contentDocument = document.getElementById("web-developer-element-information-browser").contentDocument;
- contentDocument.querySelector(".web-developer-information").textContent = WebDeveloper.Locales.getString("selectAnElementDisplayInformation");
+ contentDocument.getElementById("web-developer-information").textContent = WebDeveloper.Locales.getString("selectAnElementDisplayInformation");
contentDocument.addEventListener("click", WebDeveloper.ElementInformation.clickOutput, false);
};
@@ -104,11 +104,20 @@ WebDeveloper.StyleInformation.displayStyleInformation = function(element)
childElement.setAttribute("class", "icon-caret-down");
headingElement.appendChild(childElement);
- childElement = generatedDocument.createElement("a");
+ // If this is the embedded style sheet
+ if(styleSheet == "web-developer-embedded")
+ {
+ headingElement.appendChild(generatedDocument.createTextNode(WebDeveloper.Locales.getString("embeddedStyles")));
+ }
+ else
+ {
+ childElement = generatedDocument.createElement("a");
+
+ childElement.appendChild(generatedDocument.createTextNode(styleSheet));
+ childElement.setAttribute("href", styleSheet);
+ headingElement.appendChild(childElement);
+ }
- childElement.appendChild(generatedDocument.createTextNode(styleSheet));
- childElement.setAttribute("href", styleSheet);
- headingElement.appendChild(childElement);
styleInformation.appendChild(headingElement);
childElement = generatedDocument.createElement("pre");
@@ -128,7 +137,8 @@ WebDeveloper.StyleInformation.displayStyleInformation = function(element)
childElement = generatedDocument.createElement("p");
childElement.appendChild(generatedDocument.createTextNode(WebDeveloper.Locales.getString("noStyleInformation")));
- childElement.setAttribute("class", "web-developer-information");
+ childElement.setAttribute("class", "lead text-info");
+ childElement.setAttribute("id", "web-developer-information");
styleInformation.appendChild(childElement);
}
@@ -175,6 +185,12 @@ WebDeveloper.StyleInformation.getStyleInformation = function(element)
styleSheetHref = styleSheet.href;
styleText = "/* " + WebDeveloper.Locales.getString("line") + " " + line + " */\n" + rule.selectorText + "\n{\n";
+ // If the style sheet href is not set
+ if(!styleSheetHref)
+ {
+ styleSheetHref = "web-developer-embedded";
+ }
+
// Loop through the style rules
for(var j = 0, m = ruleStyles.length; j < m; j++)
{
@@ -263,7 +279,7 @@ WebDeveloper.StyleInformation.initialize = function()
WebDeveloper.ElementAncestors.createToolbar();
contentDocument = document.getElementById("web-developer-style-information-browser").contentDocument;
- contentDocument.querySelector(".web-developer-information").textContent = WebDeveloper.Locales.getString("selectAnElementDisplayStyles");
+ contentDocument.getElementById("web-developer-information").textContent = WebDeveloper.Locales.getString("selectAnElementDisplayStyles");
contentDocument.addEventListener("click", WebDeveloper.StyleInformation.clickOutput, false);
};
@@ -4,14 +4,37 @@ WebDeveloper.Overlay = WebDeveloper.Overlay || {};
WebDeveloper.Overlay.Miscellaneous = WebDeveloper.Overlay.Miscellaneous || {};
// Adds an href to the history
-WebDeveloper.Overlay.Miscellaneous.addToHistory = function(uri)
+WebDeveloper.Overlay.Miscellaneous.addToHistory = function(link, uri)
{
- var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIGlobalHistory2);
+ var browserHistory = Components.classes["@mozilla.org/browser/history;1"];
- // If the URI is not already in the history
- if(!globalHistory.isVisited(uri))
+ // If browser history exists
+ if(browserHistory)
{
- globalHistory.addURI(uri, false, false, null);
+ browserHistory.getService(Components.interfaces.mozIAsyncHistory).isURIVisited(uri, function(uri, alreadyVisited)
+ {
+ // If the URI is not already in the history
+ if(!alreadyVisited)
+ {
+ var asyncHistory = Components.classes["@mozilla.org/browser/history;1"].getService(Components.interfaces.mozIAsyncHistory);
+
+ asyncHistory.updatePlaces({ "uri": uri, "visits": [{ "transitionType": Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsINavHistoryService).TRANSITION_LINK, "visitDate": new Date().getTime() }] });
+ }
+
+ WebDeveloper.Overlay.Miscellaneous.recheckLink(link);
+ });
+ }
+ else
+ {
+ var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIGlobalHistory2);
+
+ // If the URI is not already in the history
+ if(!globalHistory.isVisited(uri))
+ {
+ globalHistory.addURI(uri, false, false, null);
+ }
+
+ WebDeveloper.Overlay.Miscellaneous.recheckLink(link);
}
};
@@ -159,20 +182,63 @@ WebDeveloper.Overlay.Miscellaneous.makeFramesResizable = function()
WebDeveloper.Miscellaneous.makeFramesResizable(WebDeveloper.Content.getDocuments(WebDeveloper.Common.getContentWindow()));
};
+// Forces the browser to recheck a link
+WebDeveloper.Overlay.Miscellaneous.recheckLink = function(link)
+{
+ var href = link.href;
+
+ // Force the browser to recheck the history by changing the href
+ link.href = "";
+ link.href = href;
+};
+
// Removes an href from the history
-WebDeveloper.Overlay.Miscellaneous.removeFromHistory = function(uri)
+WebDeveloper.Overlay.Miscellaneous.removeFromHistory = function(link, uri)
{
- // If the URI is in the history
- if(Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIGlobalHistory2).isVisited(uri))
+ var browserHistory = Components.classes["@mozilla.org/browser/history;1"];
+
+ // If browser history exists
+ if(browserHistory)
{
- Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIBrowserHistory).removePage(uri);
+ browserHistory.getService(Components.interfaces.mozIAsyncHistory).isURIVisited(uri, function(uri, inHistory)
+ {
+ // If the URI is in the history
+ if(inHistory)
+ {
+ Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsIBrowserHistory).removePage(uri);
+ }
+
+ WebDeveloper.Overlay.Miscellaneous.recheckLink(link);
+ });
+ }
+ else
+ {
+ var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"];
+
+ // If the URI is in the history
+ if(globalHistory.getService(Components.interfaces.nsIGlobalHistory2).isVisited(uri))
+ {
+ globalHistory.getService(Components.interfaces.nsIBrowserHistory).removePage(uri);
+ }
+
+ WebDeveloper.Overlay.Miscellaneous.recheckLink(link);
}
};
// Clears the history
WebDeveloper.Overlay.Miscellaneous.removeAllFromHistory = function()
{
- Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIBrowserHistory).removeAllPages();
+ var browserHistory = Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsIBrowserHistory);
+
+ // If browser history is set
+ if(browserHistory)
+ {
+ browserHistory.removeAllPages();
+ }
+ else
+ {
+ Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIBrowserHistory).removeAllPages();
+ }
};
// Toggles all links on the page between visited and unvisited
@@ -203,16 +269,12 @@ WebDeveloper.Overlay.Miscellaneous.toggleVisitedLinks = function(visited)
// If marking links as visited
if(visited)
{
- WebDeveloper.Overlay.Miscellaneous.addToHistory(uri);
+ WebDeveloper.Overlay.Miscellaneous.addToHistory(link, uri);
}
else
{
- WebDeveloper.Overlay.Miscellaneous.removeFromHistory(uri);
+ WebDeveloper.Overlay.Miscellaneous.removeFromHistory(link, uri);
}
-
- // Force the browser to recheck the history by changing the href
- link.href = "";
- link.href = href;
}
}
}
@@ -112,10 +112,18 @@ WebDeveloper.Overlay.isDOMInspectorAvailable = function()
return false;
};
-// Opens the error console
-WebDeveloper.Overlay.openErrorConsole = function()
+// Opens the browser console
+WebDeveloper.Overlay.openBrowserConsole = function()
{
- toJavaScriptConsole();
+ // If dev tools browser is set
+ if(gDevToolsBrowser)
+ {
+ gDevToolsBrowser.selectToolCommand(WebDeveloper.Common.getTabBrowser(), "webconsole");
+ }
+ else
+ {
+ toJavaScriptConsole();
+ }
};
// Opens a generated tab
@@ -365,14 +365,14 @@
<!ENTITY webdeveloper.view.responsive.layouts.label "Zobrazit responsivní layouty">
<!ENTITY webdeveloper.view.responsive.layouts.key "r">
<!-- Tools Features -->
+<!ENTITY webdeveloper.browser.console.label "Chybová konzola">
+<!ENTITY webdeveloper.browser.console.key "C">
<!ENTITY webdeveloper.edit.tools.label "Nastavení nástrojů…">
<!ENTITY webdeveloper.edit.tools.key "E">
<!ENTITY webdeveloper.display.page.validation.label "Zobrazit validitu stránky">
<!ENTITY webdeveloper.display.page.validation.key "Z">
<!ENTITY webdeveloper.dom.inspector.label "DOM Inspektor">
<!ENTITY webdeveloper.dom.inspector.key "D">
-<!ENTITY webdeveloper.error.console.label "Chybová konzola">
-<!ENTITY webdeveloper.error.console.key "C">
<!ENTITY webdeveloper.validate.local.css.label "Validovat místní CSS">
<!ENTITY webdeveloper.validate.local.css.key "C">
<!ENTITY webdeveloper.validate.local.html.label "Validovat místní HTML">
@@ -365,14 +365,14 @@
<!ENTITY webdeveloper.view.responsive.layouts.label "Angepasste Layouts anzeigen">
<!ENTITY webdeveloper.view.responsive.layouts.key "A">
<!-- Tools Features -->
+<!ENTITY webdeveloper.browser.console.label "Fehlerkonsole">
+<!ENTITY webdeveloper.browser.console.key "k">
<!ENTITY webdeveloper.edit.tools.label "Werkzeuge bearbeiten...">
<!ENTITY webdeveloper.edit.tools.key "W">
<!ENTITY webdeveloper.display.page.validation.label "Seitenvalidierung anzeigen">
<!ENTITY webdeveloper.display.page.validation.key "S">
<!ENTITY webdeveloper.dom.inspector.label "DOM Inspector">
<!ENTITY webdeveloper.dom.inspector.key "I">
-<!ENTITY webdeveloper.error.console.label "Fehlerkonsole">
-<!ENTITY webdeveloper.error.console.key "k">
<!ENTITY webdeveloper.validate.local.css.label "Lokales CSS validieren">
<!ENTITY webdeveloper.validate.local.css.key "L">
<!ENTITY webdeveloper.validate.local.html.label "Lokales HTML validieren">
@@ -15,14 +15,14 @@ elementInformation=Element Information
selectAnElementDisplayInformation=Select an element to display the information about it
# Style Information
+embeddedStyles=Embedded Styles
inlineStyles=Inline styles
line=Line
noStyleInformation=No style information
selectAnElementDisplayStyles=Select an element to display the styles applied to it
# Edit CSS
editCSS=Edit CSS
-embeddedStyles=Embedded Styles
openStyleSheet=Open Style Sheet
pinCSS=Pin CSS
saveStyleSheet=Save Style Sheet
@@ -392,14 +392,14 @@
<!ENTITY webdeveloper.view.responsive.layouts.key "V">
<!-- Tools Features -->
+<!ENTITY webdeveloper.browser.console.label "Browser Console">
+<!ENTITY webdeveloper.browser.console.key "B">
<!ENTITY webdeveloper.edit.tools.label "Edit Tools...">
<!ENTITY webdeveloper.edit.tools.key "E">
<!ENTITY webdeveloper.display.page.validation.label "Display Page Validation">
<!ENTITY webdeveloper.display.page.validation.key "D">
<!ENTITY webdeveloper.dom.inspector.label "DOM Inspector">
<!ENTITY webdeveloper.dom.inspector.key "I">
-<!ENTITY webdeveloper.error.console.label "Error Console">
-<!ENTITY webdeveloper.error.console.key "C">
<!ENTITY webdeveloper.validate.local.css.label "Validate Local CSS">
<!ENTITY webdeveloper.validate.local.css.key "V">
<!ENTITY webdeveloper.validate.local.html.label "Validate Local HTML">
@@ -365,14 +365,14 @@
<!ENTITY webdeveloper.view.responsive.layouts.label "Voir les modèles adaptatifs">
<!ENTITY webdeveloper.view.responsive.layouts.key "m">
<!-- Tools Features -->
+<!ENTITY webdeveloper.browser.console.label "Console d'erreur">
+<!ENTITY webdeveloper.browser.console.key "C">
<!ENTITY webdeveloper.edit.tools.label "Régler les outils…">
<!ENTITY webdeveloper.edit.tools.key "R">
<!ENTITY webdeveloper.display.page.validation.label "Afficher la page de validation">
<!ENTITY webdeveloper.display.page.validation.key "p">
<!ENTITY webdeveloper.dom.inspector.label "Inspecteur DOM">
<!ENTITY webdeveloper.dom.inspector.key "I">
-<!ENTITY webdeveloper.error.console.label "Console d'erreur">
-<!ENTITY webdeveloper.error.console.key "C">
<!ENTITY webdeveloper.validate.local.css.label "Valider les CSS locales">
<!ENTITY webdeveloper.validate.local.css.key "C">
<!ENTITY webdeveloper.validate.local.html.label "Valider le code HTML local">
@@ -365,14 +365,14 @@
<!ENTITY webdeveloper.view.responsive.layouts.label "ウィンドウサイズの変更結果を見る">
<!ENTITY webdeveloper.view.responsive.layouts.key "V">
<!-- Tools Features -->
+<!ENTITY webdeveloper.browser.console.label "エラーコンソール">
+<!ENTITY webdeveloper.browser.console.key "B">
<!ENTITY webdeveloper.edit.tools.label "ツールを編集する">
<!ENTITY webdeveloper.edit.tools.key "E">
<!ENTITY webdeveloper.display.page.validation.label "ページ検証を表示">
<!ENTITY webdeveloper.display.page.validation.key "D">
<!ENTITY webdeveloper.dom.inspector.label "DOMインスペクタ">
<!ENTITY webdeveloper.dom.inspector.key "I">
-<!ENTITY webdeveloper.error.console.label "エラーコンソール">
-<!ENTITY webdeveloper.error.console.key "C">
<!ENTITY webdeveloper.validate.local.css.label "ローカルのCSSファイルを検証">
<!ENTITY webdeveloper.validate.local.css.key "V">
<!ENTITY webdeveloper.validate.local.html.label "ローカルのHTMLファイルを検証">
@@ -365,14 +365,14 @@
<!ENTITY webdeveloper.view.responsive.layouts.label "Wyświetl układy responsywne">
<!ENTITY webdeveloper.view.responsive.layouts.key "U">
<!-- Tools Features -->
+<!ENTITY webdeveloper.browser.console.label "Konsola błędów">
+<!ENTITY webdeveloper.browser.console.key "K">
<!ENTITY webdeveloper.edit.tools.label "Narzędzia edycji…">
<!ENTITY webdeveloper.edit.tools.key "N">
<!ENTITY webdeveloper.display.page.validation.label "Sprawdź stronę">
<!ENTITY webdeveloper.display.page.validation.key "S">
<!ENTITY webdeveloper.dom.inspector.label "Inspektor DOM">
<!ENTITY webdeveloper.dom.inspector.key "I">
-<!ENTITY webdeveloper.error.console.label "Konsola błędów">
-<!ENTITY webdeveloper.error.console.key "K">
<!ENTITY webdeveloper.validate.local.css.label "Sprawdź poprawność lokalnego pliku CSS">
<!ENTITY webdeveloper.validate.local.css.key "C">
<!ENTITY webdeveloper.validate.local.html.label "Sprawdź poprawność lokalnego pliku HTML">
@@ -365,14 +365,14 @@
<!ENTITY webdeveloper.view.responsive.layouts.label "Visa layouter för anpassningsbar webbdesign">
<!ENTITY webdeveloper.view.responsive.layouts.key "V">
<!-- Verktyg Features -->
+<!ENTITY webdeveloper.browser.console.label "Felkonsol">
+<!ENTITY webdeveloper.browser.console.key "F">
<!ENTITY webdeveloper.edit.tools.label "Redigeringsverktyg…">
<!ENTITY webdeveloper.edit.tools.key "R">
<!ENTITY webdeveloper.display.page.validation.label "Visa sidvalidering">
<!ENTITY webdeveloper.display.page.validation.key "s">
<!ENTITY webdeveloper.dom.inspector.label "DOM-granskaren">
<!ENTITY webdeveloper.dom.inspector.key "D">
-<!ENTITY webdeveloper.error.console.label "Felkonsol">
-<!ENTITY webdeveloper.error.console.key "F">
<!ENTITY webdeveloper.validate.local.css.label "Validera lokal CSS">
<!ENTITY webdeveloper.validate.local.css.key "C">
<!ENTITY webdeveloper.validate.local.html.label "Validera lokal HTML">
Oops, something went wrong.

0 comments on commit 2fee300

Please sign in to comment.