зеркало из https://github.com/mozilla/pjs.git
Bug 399528: Add 'never for this site' option to the offline-app notification bar. r=mconnor, ui-r=beltzner, blocking-firefox3=mconnor
This commit is contained in:
Родитель
c2bbaae5e4
Коммит
7d76aeb7c2
|
@ -692,6 +692,10 @@ pref("browser.ssl_override_behavior", 1);
|
||||||
// 2 - show full domain (e.g. bugzilla.mozilla.org)
|
// 2 - show full domain (e.g. bugzilla.mozilla.org)
|
||||||
pref("browser.identity.ssl_domain_display", 0);
|
pref("browser.identity.ssl_domain_display", 0);
|
||||||
|
|
||||||
|
// True if the user should be prompted when a web application supports
|
||||||
|
// offline apps.
|
||||||
|
pref("browser.offline-apps.notify", true);
|
||||||
|
|
||||||
// if true, use full page zoom instead of text zoom
|
// if true, use full page zoom instead of text zoom
|
||||||
pref("browser.zoom.full", true);
|
pref("browser.zoom.full", true);
|
||||||
|
|
||||||
|
|
|
@ -5014,6 +5014,10 @@ var OfflineApps = {
|
||||||
},
|
},
|
||||||
|
|
||||||
offlineAppRequested: function(aContentWindow) {
|
offlineAppRequested: function(aContentWindow) {
|
||||||
|
if (!gPrefService.getBoolPref("browser.offline-apps.notify")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var browserWindow = this._getBrowserWindowForContentWindow(aContentWindow);
|
var browserWindow = this._getBrowserWindowForContentWindow(aContentWindow);
|
||||||
var browser = this._getBrowserForContentWindow(browserWindow,
|
var browser = this._getBrowserForContentWindow(browserWindow,
|
||||||
aContentWindow);
|
aContentWindow);
|
||||||
|
@ -5045,6 +5049,14 @@ var OfflineApps = {
|
||||||
label: bundle_browser.getString("offlineApps.allow"),
|
label: bundle_browser.getString("offlineApps.allow"),
|
||||||
accessKey: bundle_browser.getString("offlineApps.allowAccessKey"),
|
accessKey: bundle_browser.getString("offlineApps.allowAccessKey"),
|
||||||
callback: function() { OfflineApps.allowSite(); }
|
callback: function() { OfflineApps.allowSite(); }
|
||||||
|
},{
|
||||||
|
label: bundle_browser.getString("offlineApps.never"),
|
||||||
|
accessKey: bundle_browser.getString("offlineApps.neverAccessKey"),
|
||||||
|
callback: function() { OfflineApps.disallowSite(); }
|
||||||
|
},{
|
||||||
|
label: bundle_browser.getString("offlineApps.notNow"),
|
||||||
|
accessKey: bundle_browser.getString("offlineApps.notNowAccessKey"),
|
||||||
|
callback: function() { /* noop */ }
|
||||||
}];
|
}];
|
||||||
|
|
||||||
const priority = notificationBox.PRIORITY_INFO_LOW;
|
const priority = notificationBox.PRIORITY_INFO_LOW;
|
||||||
|
@ -5068,6 +5080,13 @@ var OfflineApps = {
|
||||||
this._startFetching();
|
this._startFetching();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
disallowSite: function() {
|
||||||
|
var currentURI = gBrowser.selectedBrowser.webNavigation.currentURI;
|
||||||
|
var pm = Cc["@mozilla.org/permissionmanager;1"].
|
||||||
|
getService(Ci.nsIPermissionManager);
|
||||||
|
pm.add(currentURI, "offline-app", Ci.nsIPermissionManager.DENY_ACTION);
|
||||||
|
},
|
||||||
|
|
||||||
_startFetching: function() {
|
_startFetching: function() {
|
||||||
var manifest = content.document.documentElement.getAttribute("manifest");
|
var manifest = content.document.documentElement.getAttribute("manifest");
|
||||||
if (!manifest)
|
if (!manifest)
|
||||||
|
|
|
@ -180,6 +180,30 @@ var gAdvancedPane = {
|
||||||
} catch(ex) {}
|
} catch(ex) {}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
readOfflineNotify: function()
|
||||||
|
{
|
||||||
|
var pref = document.getElementById("browser.offline-apps.notify");
|
||||||
|
var button = document.getElementById("offlineNotifyExceptions");
|
||||||
|
button.disabled = !pref.value;
|
||||||
|
return pref.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
showOfflineExceptions: function()
|
||||||
|
{
|
||||||
|
var bundlePreferences = document.getElementById("bundlePreferences");
|
||||||
|
var params = { blockVisible : false,
|
||||||
|
sessionVisible : false,
|
||||||
|
allowVisible : false,
|
||||||
|
prefilledHost : "",
|
||||||
|
permissionType : "offline-app",
|
||||||
|
manageCapability : Ci.nsIPermissionManager.DENY_ACTION,
|
||||||
|
windowTitle : bundlePreferences.getString("offlinepermissionstitle"),
|
||||||
|
introText : bundlePreferences.getString("offlinepermissionstext") };
|
||||||
|
document.documentElement.openWindow("Browser:Permissions",
|
||||||
|
"chrome://browser/content/preferences/permissions.xul",
|
||||||
|
"", params);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the list of offline applications
|
* Updates the list of offline applications
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
<!-- Network tab -->
|
<!-- Network tab -->
|
||||||
<preference id="browser.cache.disk.capacity" name="browser.cache.disk.capacity" type="int"/>
|
<preference id="browser.cache.disk.capacity" name="browser.cache.disk.capacity" type="int"/>
|
||||||
|
<preference id="browser.offline-apps.notify" name="browser.offline-apps.notify" type="bool"/>
|
||||||
|
|
||||||
<!-- Update tab -->
|
<!-- Update tab -->
|
||||||
<preference id="app.update.enabled" name="app.update.enabled" type="bool"
|
<preference id="app.update.enabled" name="app.update.enabled" type="bool"
|
||||||
|
@ -232,6 +232,16 @@
|
||||||
label="&clearCacheNow.label;" accesskey="&clearCacheNow.accesskey;"
|
label="&clearCacheNow.label;" accesskey="&clearCacheNow.accesskey;"
|
||||||
oncommand="gAdvancedPane.clearCache();"/>
|
oncommand="gAdvancedPane.clearCache();"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
|
<hbox>
|
||||||
|
<checkbox id="offlineNotify" flex="1"
|
||||||
|
label="&offlineNotify.label;" accesskey="&offlineNotify.accesskey;"
|
||||||
|
preference="browser.offline-apps.notify"
|
||||||
|
onsyncfrompreference="return gAdvancedPane.readOfflineNotify();"/>
|
||||||
|
<button id="offlineNotifyExceptions"
|
||||||
|
label="&offlineNotifyExceptions.label;"
|
||||||
|
accesskey="&offlineNotifyExceptions.accesskey;"
|
||||||
|
oncommand="gAdvancedPane.showOfflineExceptions();"/>
|
||||||
|
</hbox>
|
||||||
<hbox>
|
<hbox>
|
||||||
<vbox flex="1">
|
<vbox flex="1">
|
||||||
|
|
||||||
|
|
|
@ -177,6 +177,7 @@ var gPermissionManager = {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._type = aParams.permissionType;
|
this._type = aParams.permissionType;
|
||||||
|
this._manageCapability = aParams.manageCapability;
|
||||||
|
|
||||||
var permissionsText = document.getElementById("permissionsText");
|
var permissionsText = document.getElementById("permissionsText");
|
||||||
while (permissionsText.hasChildNodes())
|
while (permissionsText.hasChildNodes())
|
||||||
|
@ -188,12 +189,18 @@ var gPermissionManager = {
|
||||||
document.getElementById("btnBlock").hidden = !aParams.blockVisible;
|
document.getElementById("btnBlock").hidden = !aParams.blockVisible;
|
||||||
document.getElementById("btnSession").hidden = !aParams.sessionVisible;
|
document.getElementById("btnSession").hidden = !aParams.sessionVisible;
|
||||||
document.getElementById("btnAllow").hidden = !aParams.allowVisible;
|
document.getElementById("btnAllow").hidden = !aParams.allowVisible;
|
||||||
|
|
||||||
|
var urlFieldVisible = (aParams.blockVisible || aParams.sessionVisible || aParams.allowVisible);
|
||||||
|
|
||||||
var urlField = document.getElementById("url");
|
var urlField = document.getElementById("url");
|
||||||
urlField.value = aParams.prefilledHost;
|
urlField.value = aParams.prefilledHost;
|
||||||
|
urlField.hidden = !urlFieldVisible;
|
||||||
|
|
||||||
this.onHostInput(urlField);
|
this.onHostInput(urlField);
|
||||||
|
|
||||||
|
var urlLabel = document.getElementById("urlLabel");
|
||||||
|
urlLabel.hidden = !urlFieldVisible;
|
||||||
|
|
||||||
var os = Components.classes["@mozilla.org/observer-service;1"]
|
var os = Components.classes["@mozilla.org/observer-service;1"]
|
||||||
.getService(Components.interfaces.nsIObserverService);
|
.getService(Components.interfaces.nsIObserverService);
|
||||||
os.addObserver(this, "perm-changed", false);
|
os.addObserver(this, "perm-changed", false);
|
||||||
|
@ -334,7 +341,10 @@ var gPermissionManager = {
|
||||||
|
|
||||||
_addPermissionToList: function (aPermission)
|
_addPermissionToList: function (aPermission)
|
||||||
{
|
{
|
||||||
if (aPermission.type == this._type) {
|
if (aPermission.type == this._type &&
|
||||||
|
(!this._manageCapability ||
|
||||||
|
(aPermission.capability == this._manageCapability))) {
|
||||||
|
|
||||||
var host = aPermission.host;
|
var host = aPermission.host;
|
||||||
var capabilityString = this._getCapabilityString(aPermission.capability);
|
var capabilityString = this._getCapabilityString(aPermission.capability);
|
||||||
var p = new Permission(host,
|
var p = new Permission(host,
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<vbox class="contentPane" flex="1">
|
<vbox class="contentPane" flex="1">
|
||||||
<description id="permissionsText" control="url"/>
|
<description id="permissionsText" control="url"/>
|
||||||
<separator class="thin"/>
|
<separator class="thin"/>
|
||||||
<label control="url" value="&address.label;"/>
|
<label id="urlLabel" control="url" value="&address.label;"/>
|
||||||
<hbox align="start">
|
<hbox align="start">
|
||||||
<textbox id="url" flex="1"
|
<textbox id="url" flex="1"
|
||||||
oninput="gPermissionManager.onHostInput(event.target);"
|
oninput="gPermissionManager.onHostInput(event.target);"
|
||||||
|
|
|
@ -97,9 +97,13 @@ starButtonOn.tooltip=Edit this bookmark
|
||||||
starButtonOff.tooltip=Bookmark this page
|
starButtonOff.tooltip=Bookmark this page
|
||||||
|
|
||||||
# Offline web applications
|
# Offline web applications
|
||||||
offlineApps.available=This website (%S) is offering to store data on your computer for offline use.
|
offlineApps.available=This website (%S) is asking to store data on your computer for offline use.
|
||||||
offlineApps.allow=Allow
|
offlineApps.allow=Allow
|
||||||
offlineApps.allowAccessKey=A
|
offlineApps.allowAccessKey=A
|
||||||
|
offlineApps.never=Never for This Site
|
||||||
|
offlineApps.neverAccessKey=e
|
||||||
|
offlineApps.notNow=Not Now
|
||||||
|
offlineApps.notNowAccessKey=N
|
||||||
|
|
||||||
identity.identified.verifier=Verified by: %S
|
identity.identified.verifier=Verified by: %S
|
||||||
identity.identified.verified_by_you=You have added a security exception for this site
|
identity.identified.verified_by_you=You have added a security exception for this site
|
||||||
|
|
|
@ -67,7 +67,12 @@
|
||||||
<!ENTITY updateHistory.label "Show Update History">
|
<!ENTITY updateHistory.label "Show Update History">
|
||||||
<!ENTITY updateHistory.accesskey "p">
|
<!ENTITY updateHistory.accesskey "p">
|
||||||
|
|
||||||
<!ENTITY offlineAppsList.label "The following websites have data installed for offline use:">
|
<!ENTITY offlineNotify.label "Tell me when a website asks to store data for offline use">
|
||||||
|
<!ENTITY offlineNotify.accesskey "T">
|
||||||
|
<!ENTITY offlineNotifyExceptions.label "Exceptions…">
|
||||||
|
<!ENTITY offlineNotifyExceptions.accesskey "x">
|
||||||
|
|
||||||
|
<!ENTITY offlineAppsList.label "The following websites have stored data for offline use:">
|
||||||
<!ENTITY offlineAppsList.height "7em">
|
<!ENTITY offlineAppsList.height "7em">
|
||||||
<!ENTITY offlineAppsListRemove.label "Remove…">
|
<!ENTITY offlineAppsListRemove.label "Remove…">
|
||||||
<!ENTITY offlineAppsListRemove.accesskey "R">
|
<!ENTITY offlineAppsListRemove.accesskey "R">
|
||||||
|
|
|
@ -97,3 +97,5 @@ removeCookie=Remove Cookie
|
||||||
offlineAppRemoveTitle=Remove offline website data
|
offlineAppRemoveTitle=Remove offline website data
|
||||||
offlineAppRemovePrompt=After removing this data, %S will not be available offline. Are you sure you want to remove this offline website?
|
offlineAppRemovePrompt=After removing this data, %S will not be available offline. Are you sure you want to remove this offline website?
|
||||||
offlineAppRemoveConfirm=Remove offline data
|
offlineAppRemoveConfirm=Remove offline data
|
||||||
|
offlinepermissionstext=The following websites are not allowed to store data for offline use:
|
||||||
|
offlinepermissionstitle=Offline Data
|
||||||
|
|
Загрузка…
Ссылка в новой задаче