This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1284 from adobe/jason-sanjose/issue-1275
Prevent extensions from loading in test windows
- Loading branch information
Showing
11 changed files
with
262 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,92 @@ | |||
/* | |||
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a | |||
* copy of this software and associated documentation files (the "Software"), | |||
* to deal in the Software without restriction, including without limitation | |||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||
* and/or sell copies of the Software, and to permit persons to whom the | |||
* Software is furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included in | |||
* all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |||
* DEALINGS IN THE SOFTWARE. | |||
* | |||
*/ | |||
|
|||
|
|||
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ | |||
/*global define, window */ | |||
|
|||
define(function (require, exports, module) { | |||
"use strict"; | |||
|
|||
/** | |||
* Convert between URL querystring and name/value pairs. Decodes and encodes URL parameters. | |||
*/ | |||
function UrlParams() { | |||
this._store = {}; | |||
} | |||
|
|||
/** | |||
* Parse the window location by default. Optionally specify a URL to parse. | |||
* @param {string} url | |||
*/ | |||
UrlParams.prototype.parse = function (url) { | |||
if (url) { | |||
url = url.substring(indexOf("?") + 1); | |||
} else { | |||
url = window.document.location.search.substring(1); | |||
} | |||
|
|||
var urlParams = url.split("&"), | |||
p, | |||
self = this; | |||
|
|||
urlParams.forEach(function (param) { | |||
p = param.split("="); | |||
self._store[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); | |||
}); | |||
}; | |||
|
|||
/** | |||
* Store a name/value string pair | |||
* @param {!string} name | |||
* @param {!string} value | |||
*/ | |||
UrlParams.prototype.put = function (name, value) { | |||
this._store[name] = value; | |||
}; | |||
|
|||
/** | |||
* Retreive a value by name | |||
* @param {!string} name | |||
*/ | |||
UrlParams.prototype.get = function (name) { | |||
return this._store[name]; | |||
}; | |||
|
|||
/** | |||
* Encode name/value pairs as URI components. | |||
*/ | |||
UrlParams.prototype.toString = function () { | |||
var strs = [], | |||
self = this; | |||
|
|||
Object.keys(self._store).forEach(function (key) { | |||
strs.push(encodeURIComponent(key) + "=" + encodeURIComponent(self._store[key])); | |||
}); | |||
|
|||
return strs.join("&"); | |||
}; | |||
|
|||
// Define public API | |||
exports.UrlParams = UrlParams; | |||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.