(url)
| 20240 | } |
| 20241 | |
| 20242 | function isResourceUrlAllowedByPolicy(url) { |
| 20243 | var parsedUrl = urlResolve(url.toString()); |
| 20244 | var i, n, allowed = false; |
| 20245 | // Ensure that at least one item from the whitelist allows this url. |
| 20246 | for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) { |
| 20247 | if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) { |
| 20248 | allowed = true; |
| 20249 | break; |
| 20250 | } |
| 20251 | } |
| 20252 | if (allowed) { |
| 20253 | // Ensure that no item from the blacklist blocked this url. |
| 20254 | for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) { |
| 20255 | if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) { |
| 20256 | allowed = false; |
| 20257 | break; |
| 20258 | } |
| 20259 | } |
| 20260 | } |
| 20261 | return allowed; |
| 20262 | } |
| 20263 | |
| 20264 | function generateHolderType(Base) { |
| 20265 | var holderType = function TrustedValueHolderType(trustedValue) { |
no test coverage detected