Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
/angular.jsPublic archive

Commitfb04e42

Browse files
Ed Clementgkalpak
Ed Clement
authored andcommitted
test(Angular): fixangularInit() tests on Safari v15+
Previously, the `angularInit()` tests assumed that the Safari browseruses the `safari-extension:` protocol for browser extension URLs. Thisis true for versions <15. However, since v15, Safari on iOS onlyrecognizes the `chrome-extension:` protocol, which causes the tests tofail ([example failure][1]).This commit updates the tests to use the correct protocol according tothe version of Safari used.NOTE:On macOS, Safari v15+ recognizes both `safari-extension:` and`chrome-extension:`, so it is OK to always use the later with Safariv15+ (regardless of the platform).[1]:https://circleci.com/gh/angular/angular.js/3527Co-authored-by: George Kalpakas <kalpakas.g@gmail.com>Closes#17166
1 parent6a52c4f commitfb04e42

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎test/AngularSpec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,12 @@ describe('angular', function() {
17931793
}elseif(/Chrome\//.test(userAgent)){
17941794
protocol='chrome-extension:';
17951795
}elseif(/Safari\//.test(userAgent)){
1796-
protocol='safari-extension:';
1796+
// On iOS, Safari versions <15 recognize `safari-extension:`, while versions >=15 only
1797+
// recognize `chrome-extension:`.
1798+
// (On macOS, Safari v15 recognizes both protocols, so it is fine to use either.)
1799+
varmajorVersionMatch=/Version\/(\d+)/.exec(userAgent);
1800+
varmajorVersion=majorVersionMatch ?parseInt(majorVersionMatch[1],10) :0;
1801+
protocol=(majorVersion<15) ?'safari-extension:' :'chrome-extension:';
17971802
}else{
17981803
protocol='browserext:';// Upcoming standard scheme.
17991804
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp