diff --git a/caps/nsPrincipal.cpp b/caps/nsPrincipal.cpp index 492cb674aed1..60885ab548b1 100644 --- a/caps/nsPrincipal.cpp +++ b/caps/nsPrincipal.cpp @@ -31,7 +31,6 @@ #include "mozilla/HashFunctions.h" #include "nsIAppsService.h" -#include "mozIApplication.h" using namespace mozilla; diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 8d5fdd98845a..3a736518caba 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -43,7 +43,6 @@ #include "nsIDOMStorage.h" #include "nsIContentViewer.h" #include "nsIDocumentLoaderFactory.h" -#include "nsIMozBrowserFrame.h" #include "nsCURILoader.h" #include "nsDocShellCID.h" #include "nsDOMCID.h" @@ -10774,35 +10773,6 @@ nsDocShell::DoURILoad(nsIURI* aURI, "DoURILoad thinks this is a document and InternalLoad does not"); } - - // For mozWidget, display a load error if we navigate to a page which is not - // claimed in |widgetPages|. - // When we go to display a load error for an invalid mozWidget page, we will - // try to load an about:neterror page, which is also an invalid mozWidget - // page. To avoid recursion, we skip this check if aURI's scheme is "about". - - // The goal is to prevent leaking sensitive information of an invalid page of - // an app, so allowing about:blank would not be conflict to the goal. - bool isAbout = false; - rv = aURI->SchemeIs("about", &isAbout); - if (NS_SUCCEEDED(rv) && !isAbout && - nsIDocShell::GetIsApp()) { - nsCOMPtr frameElement = mScriptGlobal->AsOuter()->GetFrameElementInternal(); - if (frameElement) { - nsCOMPtr browserFrame = do_QueryInterface(frameElement); - // |GetReallyIsApp| indicates the browser frame is a valid app or widget. - // Here we prevent navigating to an app or widget which loses its validity - // by loading invalid page or other way. - if (browserFrame && !browserFrame->GetReallyIsApp()) { - nsCOMPtr serv = services::GetObserverService(); - if (serv) { - serv->NotifyObservers(GetDocument(), "invalid-widget", nullptr); - } - return NS_ERROR_MALFORMED_URI; - } - } - } - // open a channel for the url nsCOMPtr channel; diff --git a/dom/apps/AppsUtils.jsm b/dom/apps/AppsUtils.jsm index 73e58e5bebd2..6df9bbc84a0e 100644 --- a/dom/apps/AppsUtils.jsm +++ b/dom/apps/AppsUtils.jsm @@ -53,15 +53,6 @@ mozIApplication.prototype = { return (perm === Ci.nsIPermissionManager.ALLOW_ACTION); }, - hasWidgetPage: function(aPageURL) { - let uri = Services.io.newURI(aPageURL, null, null); - let filepath = AppsUtils.getFilePath(uri.path); - let eliminatedUri = Services.io.newURI(uri.prePath + filepath, null, null); - let equalCriterion = aUrl => Services.io.newURI(aUrl, null, null) - .equals(eliminatedUri); - return this.widgetPages.find(equalCriterion) !== undefined; - }, - get principal() { if (this._principal) { return this._principal; @@ -122,7 +113,6 @@ function _setAppProperties(aObj, aApp) { aObj.storeId = aApp.storeId || ""; aObj.storeVersion = aApp.storeVersion || 0; aObj.role = aApp.role || ""; - aObj.widgetPages = aApp.widgetPages || []; aObj.kind = aApp.kind; aObj.enabled = aApp.enabled !== undefined ? aApp.enabled : true; aObj.sideloaded = aApp.sideloaded; @@ -854,10 +844,6 @@ ManifestHelper.prototype = { return this._localeProp("package_path"); }, - get widgetPages() { - return this._localeProp("widgetPages"); - }, - get size() { return this._manifest["size"] || 0; }, diff --git a/dom/apps/PermissionsTable.jsm b/dom/apps/PermissionsTable.jsm index 13bd21871db8..8430c76567ed 100644 --- a/dom/apps/PermissionsTable.jsm +++ b/dom/apps/PermissionsTable.jsm @@ -268,11 +268,6 @@ this.PermissionsTable = { geolocation: { privileged: DENY_ACTION, certified: ALLOW_ACTION }, - "embed-widgets": { - app: DENY_ACTION, - privileged: ALLOW_ACTION, - certified: ALLOW_ACTION - }, "background-sensors": { app: DENY_ACTION, privileged: DENY_ACTION, diff --git a/dom/apps/tests/unit/test_has_widget_criterion.js b/dom/apps/tests/unit/test_has_widget_criterion.js deleted file mode 100644 index 31ef90e90630..000000000000 --- a/dom/apps/tests/unit/test_has_widget_criterion.js +++ /dev/null @@ -1,66 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -var {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource:///modules/AppsUtils.jsm"); -Cu.import("resource:///modules/Services.jsm"); - -add_test(function test_has_widget_criterion() { - - // follow the logic |_saveWidgetsFullPath| - let baseUri = Services.io.newURI('http://example.com', null, null); - let resolve = (aPage)=>{ - let filepath = AppsUtils.getFilePath(aPage); - - return baseUri.resolve(filepath); - }; - - let widgetPages = ['/widget.html', - '/foo/bar.html']; - let resolvedWidgetPages = widgetPages.map(resolve); - - let app = new mozIApplication({widgetPages:resolvedWidgetPages}); - - let widgetPageCheck = aPage => app.hasWidgetPage(baseUri.resolve(aPage)); - - Assert.ok(widgetPageCheck('/widget.html'), 'should pass for identical path'); - Assert.ok(widgetPageCheck('/foo/bar.html'), 'should pass for identical path'); - - Assert.ok(!widgetPageCheck('/wrong.html'), 'should not pass for wrong path'); - Assert.ok(!widgetPageCheck('/WIDGET.html'), 'should be case _sensitive_ for path'); - Assert.ok(!widgetPageCheck('/widget.HTML'), 'should be case _sensitive_ for file extension'); - - Assert.ok(widgetPageCheck('/widget.html?aQuery'), 'should be query insensitive'); - Assert.ok(widgetPageCheck('/widget.html#aHash'), 'should be hash insensitive'); - Assert.ok(widgetPageCheck('/widget.html?aQuery=aquery#aHash'), - 'should be hash/query insensitive'); - - Assert.ok(widgetPageCheck('HTTP://example.com/widget.html'), - 'should be case insensitive for protocol'); - Assert.ok(widgetPageCheck('http://EXAMPLE.COM/widget.html'), - 'should be case insensitive for domain'); - Assert.ok(widgetPageCheck('http://example.com:80/widget.html'), - 'should pass for default port'); - - Assert.ok(widgetPageCheck('HTTP://EXAMPLE.COM:80/widget.html?QueryA=queryA&QueryB=queryB#aHash'), - 'should pass for a really mess one'); - - Assert.ok(!widgetPageCheck('foo://example.com/widget.html'), - 'should not pass for wrong protocol'); - Assert.ok(!widgetPageCheck('https://example.com/widget.html'), - 'should not pass for wrong protocol'); - Assert.ok(!widgetPageCheck('/wrong/widget.html'), - 'should not pass for additional path'); - Assert.ok(!widgetPageCheck('/bar.html'), - 'should not pass for reduced path'); - Assert.ok(!widgetPageCheck('http://username:password@example.com/widget.html'), - 'should not pass for userinfo'); - Assert.ok(!widgetPageCheck('http://example.com:8080/widget.html'), - 'should not pass non-default port'); - run_next_test(); -}); - -function run_test() { - run_next_test(); -} diff --git a/dom/apps/tests/unit/xpcshell.ini b/dom/apps/tests/unit/xpcshell.ini index aa2af155cae4..9745b198f254 100644 --- a/dom/apps/tests/unit/xpcshell.ini +++ b/dom/apps/tests/unit/xpcshell.ini @@ -1,6 +1,5 @@ [DEFAULT] -[test_has_widget_criterion.js] [test_manifestSanitizer.js] [test_manifestHelper.js] [test_moziapplication.js] diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index 307a78e60308..b1a44e7905fe 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -1765,22 +1765,6 @@ nsFrameLoader::GetOwnerIsMozBrowserOrAppFrame(bool* aResult) return NS_OK; } -bool -nsFrameLoader::OwnerIsWidget() -{ - nsCOMPtr browserFrame = do_QueryInterface(mOwnerContent); - return browserFrame ? browserFrame->GetReallyIsWidget() : false; -} - - -// The xpcom getter version -NS_IMETHODIMP -nsFrameLoader::GetOwnerIsWidget(bool* aResult) -{ - *aResult = OwnerIsWidget(); - return NS_OK; -} - bool nsFrameLoader::OwnerIsAppFrame() { diff --git a/dom/base/nsFrameLoader.h b/dom/base/nsFrameLoader.h index fb820d734e52..6f9f14548e08 100644 --- a/dom/base/nsFrameLoader.h +++ b/dom/base/nsFrameLoader.h @@ -248,12 +248,6 @@ private: */ bool OwnerIsMozBrowserOrAppFrame(); - /** - * Is this a frameloader for a bona fide