@@ -1755,8 +1755,7 @@ describe('angular', function() {
1755
1755
} ;
1756
1756
}
1757
1757
1758
- it ( 'should bootstrap from an extension into an extension document for same-origin documents only' , function ( ) {
1759
-
1758
+ describe ( 'from extensions into extension documents' , function ( ) {
1760
1759
// Extension URLs are browser-specific, so we must choose a scheme that is supported by the browser to make
1761
1760
// sure that the URL is properly parsed.
1762
1761
var protocol ;
@@ -1773,10 +1772,29 @@ describe('angular', function() {
1773
1772
protocol = 'browserext:' ; // Upcoming standard scheme.
1774
1773
}
1775
1774
1776
- expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something' } , protocol ) ) ) . toBe ( true ) ;
1777
- expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something-else' } , protocol ) ) ) . toBe ( false ) ;
1775
+
1776
+ if ( protocol === 'ms-browser-extension:' ) {
1777
+ // Support: Edge 13-15
1778
+ // In Edge, URLs with protocol 'ms-browser-extension:' return "null" for the origin,
1779
+ // therefore it's impossible to know if a script is same-origin.
1780
+ it ( 'should not bootstrap for same-origin documents' , function ( ) {
1781
+ expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something' } , protocol ) ) ) . toBe ( false ) ;
1782
+ } ) ;
1783
+
1784
+ } else {
1785
+ it ( 'should bootstrap for same-origin documents' , function ( ) {
1786
+
1787
+ expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something' } , protocol ) ) ) . toBe ( true ) ;
1788
+ } ) ;
1789
+ }
1790
+
1791
+ it ( 'should not bootstrap for cross-origin documents' , function ( ) {
1792
+ expect ( allowAutoBootstrap ( createFakeDoc ( { src : protocol + '//something-else' } , protocol ) ) ) . toBe ( false ) ;
1793
+ } ) ;
1794
+
1778
1795
} ) ;
1779
1796
1797
+
1780
1798
it ( 'should bootstrap from a script with no source (e.g. src, href or xlink:href attributes)' , function ( ) {
1781
1799
1782
1800
expect ( allowAutoBootstrap ( createFakeDoc ( { src : null } ) ) ) . toBe ( true ) ;
0 commit comments