@@ -1731,8 +1731,7 @@ describe('angular', function() {
1731
1731
} ;
1732
1732
}
1733
1733
1734
- it ( 'should bootstrap from an extension into an extension document for same-origin documents only' , function ( ) {
1735
-
1734
+ describe ( 'from extensions into extension documents' , function ( ) {
1736
1735
// Extension URLs are browser-specific, so we must choose a scheme that is supported by the browser to make
1737
1736
// sure that the URL is properly parsed.
1738
1737
var protocol ;
@@ -1749,10 +1748,29 @@ describe('angular', function() {
1749
1748
protocol = 'browserext:' ; // Upcoming standard scheme.
1750
1749
}
1751
1750
1752
- expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something' } , protocol ) ) ) . toBe ( true ) ;
1753
- expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something-else' } , protocol ) ) ) . toBe ( false ) ;
1751
+
1752
+ if ( protocol === 'ms-browser-extension:' ) {
1753
+ // Support: Edge 13-15
1754
+ // In Edge, URLs with protocol 'ms-browser-extension:' return "null" for the origin,
1755
+ // therefore it's impossible to know if a script is same-origin.
1756
+ it ( 'should not bootstrap for same-origin documents' , function ( ) {
1757
+ expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something' } , protocol ) ) ) . toBe ( false ) ;
1758
+ } ) ;
1759
+
1760
+ } else {
1761
+ it ( 'should bootstrap for same-origin documents' , function ( ) {
1762
+
1763
+ expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something' } , protocol ) ) ) . toBe ( true ) ;
1764
+ } ) ;
1765
+ }
1766
+
1767
+ it ( 'should not bootstrap for cross-origin documents' , function ( ) {
1768
+ expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something-else' } , protocol ) ) ) . toBe ( false ) ;
1769
+ } ) ;
1770
+
1754
1771
} ) ;
1755
1772
1773
+
1756
1774
it ( 'should bootstrap from a script with no source (e.g. src, href or xlink:href attributes)' , function ( ) {
1757
1775
1758
1776
expect ( allowAutoBootstrap ( createFakeDoc ( { src : null } ) ) ) . toBe ( true ) ;
0 commit comments