appium-webdriveragent 13.1.3 → 13.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/WebDriverAgent.xcodeproj/project.pbxproj +23 -3
- package/WebDriverAgentLib/Commands/FBSessionCommands.m +11 -176
- package/WebDriverAgentLib/Info.plist +2 -2
- package/WebDriverAgentLib/Utilities/FBSettingsHandler.h +35 -0
- package/WebDriverAgentLib/Utilities/FBSettingsHandler.m +356 -0
- package/WebDriverAgentLib/Utilities/FBXPath-Private.h +5 -0
- package/WebDriverAgentLib/Utilities/FBXPath.m +36 -4
- package/WebDriverAgentLib/Utilities/FBXPathExtensions.h +40 -0
- package/WebDriverAgentLib/Utilities/FBXPathExtensions.m +418 -0
- package/WebDriverAgentLib/Utilities/XCTestPrivateSymbols.m +5 -0
- package/WebDriverAgentLib/Vendor/CocoaHTTPServer/Responses/HTTPErrorResponse.m +1 -3
- package/WebDriverAgentTests/IntegrationTests/FBXPathIntegrationTests.m +103 -0
- package/WebDriverAgentTests/UnitTests/FBXPathTests.m +125 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [13.2.1](https://github.com/appium/WebDriverAgent/compare/v13.2.0...v13.2.1) (2026-06-06)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Refactor settings handling API ([#1148](https://github.com/appium/WebDriverAgent/issues/1148)) ([ff7ac36](https://github.com/appium/WebDriverAgent/commit/ff7ac368debb22659509169a0eca530bae3dc879))
|
|
6
|
+
|
|
7
|
+
## [13.2.0](https://github.com/appium/WebDriverAgent/compare/v13.1.3...v13.2.0) (2026-05-26)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add XPath extensions ([#1144](https://github.com/appium/WebDriverAgent/issues/1144)) ([a975b89](https://github.com/appium/WebDriverAgent/commit/a975b89ac998d31a72bf3723b843d85af8867cf0))
|
|
12
|
+
|
|
1
13
|
## [13.1.3](https://github.com/appium/WebDriverAgent/compare/v13.1.2...v13.1.3) (2026-05-24)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
641EE5D92240C5CA00173FCB /* XCUIElement+FBPickerWheel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7136A4781E8918E60024FC3D /* XCUIElement+FBPickerWheel.m */; };
|
|
53
53
|
641EE5DA2240C5CA00173FCB /* XCUIApplicationProcessDelay.m in Sources */ = {isa = PBXBuildFile; fileRef = 6385F4A5220A40760095BBDB /* XCUIApplicationProcessDelay.m */; };
|
|
54
54
|
641EE5DB2240C5CA00173FCB /* FBXPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 711084431DA3AA7500F913D6 /* FBXPath.m */; };
|
|
55
|
+
71B2E0042733FB970074B004 /* FBXPathExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B2E0022733FB970074B002 /* FBXPathExtensions.m */; };
|
|
55
56
|
641EE5DC2240C5CA00173FCB /* XCUIApplication+FBAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 719CD8FB2126C88B00C7D0C2 /* XCUIApplication+FBAlert.m */; };
|
|
56
57
|
641EE5DE2240C5CA00173FCB /* XCUIApplication+FBTouchAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BD20721F86116100B36EC2 /* XCUIApplication+FBTouchAction.m */; };
|
|
57
58
|
641EE5DF2240C5CA00173FCB /* FBWebServer.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB78D1CAEDF0C008C271F /* FBWebServer.m */; };
|
|
@@ -316,6 +317,7 @@
|
|
|
316
317
|
64E3502F2AC0B6FE005F3ACB /* NSDictionary+FBUtf8SafeDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 716F0D9F2A16CA1000CDD977 /* NSDictionary+FBUtf8SafeDictionary.h */; };
|
|
317
318
|
711084441DA3AA7500F913D6 /* FBXPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 711084421DA3AA7500F913D6 /* FBXPath.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
318
319
|
711084451DA3AA7500F913D6 /* FBXPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 711084431DA3AA7500F913D6 /* FBXPath.m */; };
|
|
320
|
+
71B2E0062733FB970074B006 /* FBXPathExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B2E0022733FB970074B002 /* FBXPathExtensions.m */; };
|
|
319
321
|
7119097C2152580600BA3C7E /* XCUIScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 7119097B2152580600BA3C7E /* XCUIScreen.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
320
322
|
7119E1EC1E891F8600D0B125 /* FBPickerWheelSelectTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7119E1EB1E891F8600D0B125 /* FBPickerWheelSelectTests.m */; };
|
|
321
323
|
711CD03425ED1106001C01D2 /* XCUIScreenDataSource-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 711CD03325ED1106001C01D2 /* XCUIScreenDataSource-Protocol.h */; };
|
|
@@ -520,6 +522,10 @@
|
|
|
520
522
|
71F3E7D525417FF400E0C22B /* FBSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 71F3E7D225417FF400E0C22B /* FBSettings.h */; };
|
|
521
523
|
71F3E7D625417FF400E0C22B /* FBSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3E7D325417FF400E0C22B /* FBSettings.m */; };
|
|
522
524
|
71F3E7D725417FF400E0C22B /* FBSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3E7D325417FF400E0C22B /* FBSettings.m */; };
|
|
525
|
+
71F3E7D825417FF400E0C22C /* FBSettingsHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 71F3E7D625417FF400E0C22C /* FBSettingsHandler.h */; };
|
|
526
|
+
71F3E7D925417FF400E0C22C /* FBSettingsHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 71F3E7D625417FF400E0C22C /* FBSettingsHandler.h */; };
|
|
527
|
+
71F3E7DA25417FF400E0C22C /* FBSettingsHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3E7D725417FF400E0C22C /* FBSettingsHandler.m */; };
|
|
528
|
+
71F3E7DB25417FF400E0C22C /* FBSettingsHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3E7D725417FF400E0C22C /* FBSettingsHandler.m */; };
|
|
523
529
|
71F5BE23252E576C00EE9EBA /* XCUIElement+FBSwiping.h in Headers */ = {isa = PBXBuildFile; fileRef = 71F5BE21252E576C00EE9EBA /* XCUIElement+FBSwiping.h */; };
|
|
524
530
|
71F5BE24252E576C00EE9EBA /* XCUIElement+FBSwiping.h in Headers */ = {isa = PBXBuildFile; fileRef = 71F5BE21252E576C00EE9EBA /* XCUIElement+FBSwiping.h */; };
|
|
525
531
|
71F5BE25252E576C00EE9EBA /* XCUIElement+FBSwiping.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F5BE22252E576C00EE9EBA /* XCUIElement+FBSwiping.m */; };
|
|
@@ -976,6 +982,8 @@
|
|
|
976
982
|
64B26509228CE4FF002A5025 /* FBTVNavigationTracker-Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FBTVNavigationTracker-Private.h"; sourceTree = "<group>"; };
|
|
977
983
|
711084421DA3AA7500F913D6 /* FBXPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBXPath.h; sourceTree = "<group>"; };
|
|
978
984
|
711084431DA3AA7500F913D6 /* FBXPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBXPath.m; sourceTree = "<group>"; };
|
|
985
|
+
71B2E0012733FB970074B001 /* FBXPathExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBXPathExtensions.h; sourceTree = "<group>"; };
|
|
986
|
+
71B2E0022733FB970074B002 /* FBXPathExtensions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBXPathExtensions.m; sourceTree = "<group>"; };
|
|
979
987
|
7119097B2152580600BA3C7E /* XCUIScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCUIScreen.h; sourceTree = "<group>"; };
|
|
980
988
|
7119E1EB1E891F8600D0B125 /* FBPickerWheelSelectTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBPickerWheelSelectTests.m; sourceTree = "<group>"; };
|
|
981
989
|
711CD03325ED1106001C01D2 /* XCUIScreenDataSource-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "XCUIScreenDataSource-Protocol.h"; sourceTree = "<group>"; };
|
|
@@ -1110,6 +1118,8 @@
|
|
|
1110
1118
|
71E75E6C254824230099FC87 /* XCUIElementQuery+FBHelpers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "XCUIElementQuery+FBHelpers.m"; sourceTree = "<group>"; };
|
|
1111
1119
|
71F3E7D225417FF400E0C22B /* FBSettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBSettings.h; sourceTree = "<group>"; };
|
|
1112
1120
|
71F3E7D325417FF400E0C22B /* FBSettings.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBSettings.m; sourceTree = "<group>"; };
|
|
1121
|
+
71F3E7D625417FF400E0C22C /* FBSettingsHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBSettingsHandler.h; sourceTree = "<group>"; };
|
|
1122
|
+
71F3E7D725417FF400E0C22C /* FBSettingsHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBSettingsHandler.m; sourceTree = "<group>"; };
|
|
1113
1123
|
71F5BE21252E576C00EE9EBA /* XCUIElement+FBSwiping.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XCUIElement+FBSwiping.h"; sourceTree = "<group>"; };
|
|
1114
1124
|
71F5BE22252E576C00EE9EBA /* XCUIElement+FBSwiping.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "XCUIElement+FBSwiping.m"; sourceTree = "<group>"; };
|
|
1115
1125
|
71F5BE33252E5B2200EE9EBA /* FBElementSwipingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBElementSwipingTests.m; sourceTree = "<group>"; };
|
|
@@ -1978,6 +1988,8 @@
|
|
|
1978
1988
|
EE9AB7921CAEDF0C008C271F /* FBRuntimeUtils.m */,
|
|
1979
1989
|
71F3E7D225417FF400E0C22B /* FBSettings.h */,
|
|
1980
1990
|
71F3E7D325417FF400E0C22B /* FBSettings.m */,
|
|
1991
|
+
71F3E7D625417FF400E0C22C /* FBSettingsHandler.h */,
|
|
1992
|
+
71F3E7D725417FF400E0C22C /* FBSettingsHandler.m */,
|
|
1981
1993
|
715AFABF1FFA29180053896D /* FBScreen.h */,
|
|
1982
1994
|
715AFAC01FFA29180053896D /* FBScreen.m */,
|
|
1983
1995
|
71C9EAAA25E8415A00470CD8 /* FBScreenshot.h */,
|
|
@@ -2000,9 +2012,11 @@
|
|
|
2000
2012
|
714D88CA2733FB970074A925 /* FBXMLGenerationOptions.h */,
|
|
2001
2013
|
714D88CB2733FB970074A925 /* FBXMLGenerationOptions.m */,
|
|
2002
2014
|
712A0C861DA3E55D007D02E5 /* FBXPath-Private.h */,
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2015
|
+
711084421DA3AA7500F913D6 /* FBXPath.h */,
|
|
2016
|
+
711084431DA3AA7500F913D6 /* FBXPath.m */,
|
|
2017
|
+
71B2E0012733FB970074B001 /* FBXPathExtensions.h */,
|
|
2018
|
+
71B2E0022733FB970074B002 /* FBXPathExtensions.m */,
|
|
2019
|
+
EE6B64FB1D0F86EF00E85F5D /* XCTestPrivateSymbols.h */,
|
|
2006
2020
|
EE6B64FC1D0F86EF00E85F5D /* XCTestPrivateSymbols.m */,
|
|
2007
2021
|
633E904A220DEE7F007CADF9 /* XCUIApplicationProcessDelay.h */,
|
|
2008
2022
|
6385F4A5220A40760095BBDB /* XCUIApplicationProcessDelay.m */,
|
|
@@ -2327,6 +2341,7 @@
|
|
|
2327
2341
|
13DE7A50287C46BB003243C6 /* FBXCElementSnapshot.h in Headers */,
|
|
2328
2342
|
13DE7A56287CA1EC003243C6 /* FBXCElementSnapshotWrapper.h in Headers */,
|
|
2329
2343
|
71F3E7D525417FF400E0C22B /* FBSettings.h in Headers */,
|
|
2344
|
+
71F3E7D825417FF400E0C22C /* FBSettingsHandler.h in Headers */,
|
|
2330
2345
|
641EE63A2240C5CA00173FCB /* XCTest.h in Headers */,
|
|
2331
2346
|
641EE63B2240C5CA00173FCB /* FBAlertsMonitor.h in Headers */,
|
|
2332
2347
|
641EE63D2240C5CA00173FCB /* FBSession.h in Headers */,
|
|
@@ -2740,6 +2755,7 @@
|
|
|
2740
2755
|
719DCF152601EAFB000E765F /* FBNotificationsHelper.h in Headers */,
|
|
2741
2756
|
EE35AD4A1E3B77D600A02D78 /* XCTestExpectationDelegate-Protocol.h in Headers */,
|
|
2742
2757
|
71F3E7D425417FF400E0C22B /* FBSettings.h in Headers */,
|
|
2758
|
+
71F3E7D925417FF400E0C22C /* FBSettingsHandler.h in Headers */,
|
|
2743
2759
|
EE35AD641E3B77D600A02D78 /* XCTUIApplicationMonitor-Protocol.h in Headers */,
|
|
2744
2760
|
EE35AD591E3B77D600A02D78 /* XCTKVOExpectation.h in Headers */,
|
|
2745
2761
|
13DE7A43287C2A8D003243C6 /* FBXCAccessibilityElement.h in Headers */,
|
|
@@ -3153,9 +3169,11 @@
|
|
|
3153
3169
|
E444DCD624917A5E0060D7EB /* DDRange.m in Sources */,
|
|
3154
3170
|
641EE5D72240C5CA00173FCB /* FBScreenshotCommands.m in Sources */,
|
|
3155
3171
|
71F3E7D725417FF400E0C22B /* FBSettings.m in Sources */,
|
|
3172
|
+
71F3E7DA25417FF400E0C22C /* FBSettingsHandler.m in Sources */,
|
|
3156
3173
|
641EE5D92240C5CA00173FCB /* XCUIElement+FBPickerWheel.m in Sources */,
|
|
3157
3174
|
641EE5DA2240C5CA00173FCB /* XCUIApplicationProcessDelay.m in Sources */,
|
|
3158
3175
|
641EE5DB2240C5CA00173FCB /* FBXPath.m in Sources */,
|
|
3176
|
+
71B2E0042733FB970074B004 /* FBXPathExtensions.m in Sources */,
|
|
3159
3177
|
71C8E55425399A6B008572C1 /* XCUIApplication+FBQuiescence.m in Sources */,
|
|
3160
3178
|
641EE5DC2240C5CA00173FCB /* XCUIApplication+FBAlert.m in Sources */,
|
|
3161
3179
|
641EE70F2240CE4800173FCB /* FBTVNavigationTracker.m in Sources */,
|
|
@@ -3277,6 +3295,7 @@
|
|
|
3277
3295
|
6385F4A7220A40760095BBDB /* XCUIApplicationProcessDelay.m in Sources */,
|
|
3278
3296
|
71A5C67529A4F39600421C37 /* XCTIssue+FBPatcher.m in Sources */,
|
|
3279
3297
|
711084451DA3AA7500F913D6 /* FBXPath.m in Sources */,
|
|
3298
|
+
71B2E0062733FB970074B006 /* FBXPathExtensions.m in Sources */,
|
|
3280
3299
|
719CD8FD2126C88B00C7D0C2 /* XCUIApplication+FBAlert.m in Sources */,
|
|
3281
3300
|
13DE7A45287C2A8D003243C6 /* FBXCAccessibilityElement.m in Sources */,
|
|
3282
3301
|
641EE70E2240CE4800173FCB /* FBTVNavigationTracker.m in Sources */,
|
|
@@ -3366,6 +3385,7 @@
|
|
|
3366
3385
|
EE158AB91CBD456F00A3E3F0 /* FBAlertViewCommands.m in Sources */,
|
|
3367
3386
|
71BB58F12B96511800CB9BFE /* FBVideoCommands.m in Sources */,
|
|
3368
3387
|
71F3E7D625417FF400E0C22B /* FBSettings.m in Sources */,
|
|
3388
|
+
71F3E7DB25417FF400E0C22C /* FBSettingsHandler.m in Sources */,
|
|
3369
3389
|
13DE7A57287CA1EC003243C6 /* FBXCElementSnapshotWrapper.m in Sources */,
|
|
3370
3390
|
71BB58F82B96531900CB9BFE /* FBScreenRecordingContainer.m in Sources */,
|
|
3371
3391
|
EE158AB31CBD456F00A3E3F0 /* XCUIElement+FBScrolling.m in Sources */,
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
#import "FBSessionCommands.h"
|
|
10
10
|
|
|
11
11
|
#import "FBCapabilities.h"
|
|
12
|
-
#import "FBClassChainQueryParser.h"
|
|
13
12
|
#import "FBConfiguration.h"
|
|
14
13
|
#import "FBExceptions.h"
|
|
15
14
|
#import "FBLogger.h"
|
|
@@ -17,8 +16,8 @@
|
|
|
17
16
|
#import "FBRouteRequest.h"
|
|
18
17
|
#import "FBSession.h"
|
|
19
18
|
#import "FBSettings.h"
|
|
19
|
+
#import "FBSettingsHandler.h"
|
|
20
20
|
#import "FBRuntimeUtils.h"
|
|
21
|
-
#import "FBActiveAppDetectionPoint.h"
|
|
22
21
|
#import "FBXCodeCompatibility.h"
|
|
23
22
|
#import "XCUIApplication+FBHelpers.h"
|
|
24
23
|
#import "XCUIApplication+FBQuiescence.h"
|
|
@@ -324,192 +323,28 @@
|
|
|
324
323
|
|
|
325
324
|
+ (id<FBResponsePayload>)handleGetSettings:(FBRouteRequest *)request
|
|
326
325
|
{
|
|
327
|
-
return FBResponseWithObject(
|
|
328
|
-
@{
|
|
329
|
-
FB_SETTING_USE_COMPACT_RESPONSES: @([FBConfiguration shouldUseCompactResponses]),
|
|
330
|
-
FB_SETTING_ELEMENT_RESPONSE_ATTRIBUTES: [FBConfiguration elementResponseAttributes],
|
|
331
|
-
FB_SETTING_MJPEG_SERVER_SCREENSHOT_QUALITY: @([FBConfiguration mjpegServerScreenshotQuality]),
|
|
332
|
-
FB_SETTING_MJPEG_SERVER_FRAMERATE: @([FBConfiguration mjpegServerFramerate]),
|
|
333
|
-
FB_SETTING_MJPEG_SCALING_FACTOR: @([FBConfiguration mjpegScalingFactor]),
|
|
334
|
-
FB_SETTING_MJPEG_FIX_ORIENTATION: @([FBConfiguration mjpegShouldFixOrientation]),
|
|
335
|
-
FB_SETTING_SCREENSHOT_QUALITY: @([FBConfiguration screenshotQuality]),
|
|
336
|
-
FB_SETTING_KEYBOARD_AUTOCORRECTION: @([FBConfiguration keyboardAutocorrection]),
|
|
337
|
-
FB_SETTING_KEYBOARD_PREDICTION: @([FBConfiguration keyboardPrediction]),
|
|
338
|
-
FB_SETTING_SNAPSHOT_MAX_DEPTH: @([FBConfiguration snapshotMaxDepth]),
|
|
339
|
-
FB_SETTING_SNAPSHOT_MAX_CHILDREN: @([FBConfiguration snapshotMaxChildren]),
|
|
340
|
-
FB_SETTING_USE_FIRST_MATCH: @([FBConfiguration useFirstMatch]),
|
|
341
|
-
FB_SETTING_WAIT_FOR_IDLE_TIMEOUT: @([FBConfiguration waitForIdleTimeout]),
|
|
342
|
-
FB_SETTING_ANIMATION_COOL_OFF_TIMEOUT: @([FBConfiguration animationCoolOffTimeout]),
|
|
343
|
-
FB_SETTING_BOUND_ELEMENTS_BY_INDEX: @([FBConfiguration boundElementsByIndex]),
|
|
344
|
-
FB_SETTING_REDUCE_MOTION: @([FBConfiguration reduceMotionEnabled]),
|
|
345
|
-
FB_SETTING_DEFAULT_ACTIVE_APPLICATION: request.session.defaultActiveApplication,
|
|
346
|
-
FB_SETTING_ACTIVE_APP_DETECTION_POINT: FBActiveAppDetectionPoint.sharedInstance.stringCoordinates,
|
|
347
|
-
FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR: FBConfiguration.acceptAlertButtonSelector,
|
|
348
|
-
FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR: FBConfiguration.dismissAlertButtonSelector,
|
|
349
|
-
FB_SETTING_AUTO_CLICK_ALERT_SELECTOR: FBConfiguration.autoClickAlertSelector,
|
|
350
|
-
FB_SETTING_DEFAULT_ALERT_ACTION: request.session.defaultAlertAction ?: @"",
|
|
351
|
-
FB_SETTING_MAX_TYPING_FREQUENCY: @([FBConfiguration maxTypingFrequency]),
|
|
352
|
-
FB_SETTING_RESPECT_SYSTEM_ALERTS: @([FBConfiguration shouldRespectSystemAlerts]),
|
|
353
|
-
FB_SETTING_USE_CLEAR_TEXT_SHORTCUT: @([FBConfiguration useClearTextShortcut]),
|
|
354
|
-
FB_SETTING_INCLUDE_HITTABLE_IN_PAGE_SOURCE: @([FBConfiguration includeHittableInPageSource]),
|
|
355
|
-
FB_SETTING_INCLUDE_NATIVE_FRAME_IN_PAGE_SOURCE: @([FBConfiguration includeNativeFrameInPageSource]),
|
|
356
|
-
FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE: @([FBConfiguration includeMinMaxValueInPageSource]),
|
|
357
|
-
FB_SETTING_INCLUDE_CUSTOM_ACTIONS_IN_PAGE_SOURCE: @([FBConfiguration includeCustomActionsInPageSource]),
|
|
358
|
-
FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS: @([FBConfiguration enforceCustomSnapshots]),
|
|
359
|
-
FB_SETTING_LIMIT_XPATH_CONTEXT_SCOPE: @([FBConfiguration limitXpathContextScope]),
|
|
360
|
-
#if !TARGET_OS_TV
|
|
361
|
-
FB_SETTING_SCREENSHOT_ORIENTATION: [FBConfiguration humanReadableScreenshotOrientation],
|
|
362
|
-
#endif
|
|
363
|
-
}
|
|
364
|
-
);
|
|
326
|
+
return FBResponseWithObject([FBSettingsHandler currentSettingsForSession:request.session]);
|
|
365
327
|
}
|
|
366
328
|
|
|
367
|
-
// TODO if we get lots more settings, handling them with a series of if-statements will be unwieldy
|
|
368
|
-
// and this should be refactored
|
|
369
329
|
+ (id<FBResponsePayload>)handleSetSettings:(FBRouteRequest *)request
|
|
370
330
|
{
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
if (nil != [settings objectForKey:FB_SETTING_ELEMENT_RESPONSE_ATTRIBUTES]) {
|
|
377
|
-
[FBConfiguration setElementResponseAttributes:(NSString *)[settings objectForKey:FB_SETTING_ELEMENT_RESPONSE_ATTRIBUTES]];
|
|
378
|
-
}
|
|
379
|
-
if (nil != [settings objectForKey:FB_SETTING_MJPEG_SERVER_SCREENSHOT_QUALITY]) {
|
|
380
|
-
[FBConfiguration setMjpegServerScreenshotQuality:[[settings objectForKey:FB_SETTING_MJPEG_SERVER_SCREENSHOT_QUALITY] unsignedIntegerValue]];
|
|
381
|
-
}
|
|
382
|
-
if (nil != [settings objectForKey:FB_SETTING_MJPEG_SERVER_FRAMERATE]) {
|
|
383
|
-
[FBConfiguration setMjpegServerFramerate:[[settings objectForKey:FB_SETTING_MJPEG_SERVER_FRAMERATE] unsignedIntegerValue]];
|
|
384
|
-
}
|
|
385
|
-
if (nil != [settings objectForKey:FB_SETTING_SCREENSHOT_QUALITY]) {
|
|
386
|
-
[FBConfiguration setScreenshotQuality:[[settings objectForKey:FB_SETTING_SCREENSHOT_QUALITY] unsignedIntegerValue]];
|
|
387
|
-
}
|
|
388
|
-
if (nil != [settings objectForKey:FB_SETTING_MJPEG_SCALING_FACTOR]) {
|
|
389
|
-
[FBConfiguration setMjpegScalingFactor:[[settings objectForKey:FB_SETTING_MJPEG_SCALING_FACTOR] floatValue]];
|
|
390
|
-
}
|
|
391
|
-
if (nil != [settings objectForKey:FB_SETTING_MJPEG_FIX_ORIENTATION]) {
|
|
392
|
-
[FBConfiguration setMjpegShouldFixOrientation:[[settings objectForKey:FB_SETTING_MJPEG_FIX_ORIENTATION] boolValue]];
|
|
393
|
-
}
|
|
394
|
-
if (nil != [settings objectForKey:FB_SETTING_KEYBOARD_AUTOCORRECTION]) {
|
|
395
|
-
[FBConfiguration setKeyboardAutocorrection:[[settings objectForKey:FB_SETTING_KEYBOARD_AUTOCORRECTION] boolValue]];
|
|
331
|
+
id settingsArgument = request.arguments[@"settings"];
|
|
332
|
+
if (nil != settingsArgument && ![settingsArgument isKindOfClass:NSDictionary.class]) {
|
|
333
|
+
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:@"settings must be a dictionary"
|
|
334
|
+
traceback:nil]);
|
|
396
335
|
}
|
|
397
|
-
|
|
398
|
-
|
|
336
|
+
NSDictionary *settings = settingsArgument ?: @{};
|
|
337
|
+
FBCommandStatus *status = [FBSettingsHandler applySettings:settings
|
|
338
|
+
toSession:request.session];
|
|
339
|
+
if (status.hasError) {
|
|
340
|
+
return FBResponseWithStatus(status);
|
|
399
341
|
}
|
|
400
|
-
if (nil != [settings objectForKey:FB_SETTING_RESPECT_SYSTEM_ALERTS]) {
|
|
401
|
-
[FBConfiguration setShouldRespectSystemAlerts:[[settings objectForKey:FB_SETTING_RESPECT_SYSTEM_ALERTS] boolValue]];
|
|
402
|
-
}
|
|
403
|
-
if (nil != [settings objectForKey:FB_SETTING_SNAPSHOT_MAX_DEPTH]) {
|
|
404
|
-
[FBConfiguration setSnapshotMaxDepth:[[settings objectForKey:FB_SETTING_SNAPSHOT_MAX_DEPTH] intValue]];
|
|
405
|
-
}
|
|
406
|
-
if (nil != [settings objectForKey:FB_SETTING_SNAPSHOT_MAX_CHILDREN]) {
|
|
407
|
-
[FBConfiguration setSnapshotMaxChildren:[[settings objectForKey:FB_SETTING_SNAPSHOT_MAX_CHILDREN] intValue]];
|
|
408
|
-
}
|
|
409
|
-
if (nil != [settings objectForKey:FB_SETTING_USE_FIRST_MATCH]) {
|
|
410
|
-
[FBConfiguration setUseFirstMatch:[[settings objectForKey:FB_SETTING_USE_FIRST_MATCH] boolValue]];
|
|
411
|
-
}
|
|
412
|
-
if (nil != [settings objectForKey:FB_SETTING_BOUND_ELEMENTS_BY_INDEX]) {
|
|
413
|
-
[FBConfiguration setBoundElementsByIndex:[[settings objectForKey:FB_SETTING_BOUND_ELEMENTS_BY_INDEX] boolValue]];
|
|
414
|
-
}
|
|
415
|
-
if (nil != [settings objectForKey:FB_SETTING_REDUCE_MOTION]) {
|
|
416
|
-
[FBConfiguration setReduceMotionEnabled:[[settings objectForKey:FB_SETTING_REDUCE_MOTION] boolValue]];
|
|
417
|
-
}
|
|
418
|
-
if (nil != [settings objectForKey:FB_SETTING_DEFAULT_ACTIVE_APPLICATION]) {
|
|
419
|
-
request.session.defaultActiveApplication = (NSString *)[settings objectForKey:FB_SETTING_DEFAULT_ACTIVE_APPLICATION];
|
|
420
|
-
}
|
|
421
|
-
if (nil != [settings objectForKey:FB_SETTING_ACTIVE_APP_DETECTION_POINT]) {
|
|
422
|
-
NSError *error;
|
|
423
|
-
if (![FBActiveAppDetectionPoint.sharedInstance setCoordinatesWithString:(NSString *)[settings objectForKey:FB_SETTING_ACTIVE_APP_DETECTION_POINT]
|
|
424
|
-
error:&error]) {
|
|
425
|
-
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:error.localizedDescription
|
|
426
|
-
traceback:nil]);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
if (nil != [settings objectForKey:FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR]) {
|
|
430
|
-
[FBConfiguration setAcceptAlertButtonSelector:(NSString *)[settings objectForKey:FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR]];
|
|
431
|
-
}
|
|
432
|
-
if (nil != [settings objectForKey:FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR]) {
|
|
433
|
-
[FBConfiguration setDismissAlertButtonSelector:(NSString *)[settings objectForKey:FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR]];
|
|
434
|
-
}
|
|
435
|
-
if (nil != [settings objectForKey:FB_SETTING_AUTO_CLICK_ALERT_SELECTOR]) {
|
|
436
|
-
FBCommandStatus *status = [self.class configureAutoClickAlertWithSelector:settings[FB_SETTING_AUTO_CLICK_ALERT_SELECTOR]
|
|
437
|
-
forSession:request.session];
|
|
438
|
-
if (status.hasError) {
|
|
439
|
-
return FBResponseWithStatus(status);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
if (nil != [settings objectForKey:FB_SETTING_WAIT_FOR_IDLE_TIMEOUT]) {
|
|
443
|
-
[FBConfiguration setWaitForIdleTimeout:[[settings objectForKey:FB_SETTING_WAIT_FOR_IDLE_TIMEOUT] doubleValue]];
|
|
444
|
-
}
|
|
445
|
-
if (nil != [settings objectForKey:FB_SETTING_ANIMATION_COOL_OFF_TIMEOUT]) {
|
|
446
|
-
[FBConfiguration setAnimationCoolOffTimeout:[[settings objectForKey:FB_SETTING_ANIMATION_COOL_OFF_TIMEOUT] doubleValue]];
|
|
447
|
-
}
|
|
448
|
-
if ([[settings objectForKey:FB_SETTING_DEFAULT_ALERT_ACTION] isKindOfClass:NSString.class]) {
|
|
449
|
-
request.session.defaultAlertAction = [settings[FB_SETTING_DEFAULT_ALERT_ACTION] lowercaseString];
|
|
450
|
-
}
|
|
451
|
-
if (nil != [settings objectForKey:FB_SETTING_MAX_TYPING_FREQUENCY]) {
|
|
452
|
-
[FBConfiguration setMaxTypingFrequency:[[settings objectForKey:FB_SETTING_MAX_TYPING_FREQUENCY] unsignedIntegerValue]];
|
|
453
|
-
}
|
|
454
|
-
if (nil != [settings objectForKey:FB_SETTING_USE_CLEAR_TEXT_SHORTCUT]) {
|
|
455
|
-
[FBConfiguration setUseClearTextShortcut:[[settings objectForKey:FB_SETTING_USE_CLEAR_TEXT_SHORTCUT] boolValue]];
|
|
456
|
-
}
|
|
457
|
-
if (nil != [settings objectForKey:FB_SETTING_INCLUDE_HITTABLE_IN_PAGE_SOURCE]) {
|
|
458
|
-
[FBConfiguration setIncludeHittableInPageSource:[[settings objectForKey:FB_SETTING_INCLUDE_HITTABLE_IN_PAGE_SOURCE] boolValue]];
|
|
459
|
-
}
|
|
460
|
-
if (nil != [settings objectForKey:FB_SETTING_INCLUDE_NATIVE_FRAME_IN_PAGE_SOURCE]) {
|
|
461
|
-
[FBConfiguration setIncludeNativeFrameInPageSource:[[settings objectForKey:FB_SETTING_INCLUDE_NATIVE_FRAME_IN_PAGE_SOURCE] boolValue]];
|
|
462
|
-
}
|
|
463
|
-
if (nil != [settings objectForKey:FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE]) {
|
|
464
|
-
[FBConfiguration setIncludeMinMaxValueInPageSource:[[settings objectForKey:FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE] boolValue]];
|
|
465
|
-
}
|
|
466
|
-
if (nil != [settings objectForKey:FB_SETTING_INCLUDE_CUSTOM_ACTIONS_IN_PAGE_SOURCE]) {
|
|
467
|
-
[FBConfiguration setIncludeCustomActionsInPageSource:[[settings objectForKey:FB_SETTING_INCLUDE_CUSTOM_ACTIONS_IN_PAGE_SOURCE] boolValue]];
|
|
468
|
-
}
|
|
469
|
-
if (nil != [settings objectForKey:FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS]) {
|
|
470
|
-
[FBConfiguration setEnforceCustomSnapshots:[[settings objectForKey:FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS] boolValue]];
|
|
471
|
-
}
|
|
472
|
-
if (nil != [settings objectForKey:FB_SETTING_LIMIT_XPATH_CONTEXT_SCOPE]) {
|
|
473
|
-
[FBConfiguration setLimitXpathContextScope:[[settings objectForKey:FB_SETTING_LIMIT_XPATH_CONTEXT_SCOPE] boolValue]];
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
#if !TARGET_OS_TV
|
|
477
|
-
if (nil != [settings objectForKey:FB_SETTING_SCREENSHOT_ORIENTATION]) {
|
|
478
|
-
NSError *error;
|
|
479
|
-
if (![FBConfiguration setScreenshotOrientation:(NSString *)[settings objectForKey:FB_SETTING_SCREENSHOT_ORIENTATION]
|
|
480
|
-
error:&error]) {
|
|
481
|
-
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:error.localizedDescription
|
|
482
|
-
traceback:nil]);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
#endif
|
|
486
|
-
|
|
487
342
|
return [self handleGetSettings:request];
|
|
488
343
|
}
|
|
489
344
|
|
|
490
345
|
|
|
491
346
|
#pragma mark - Helpers
|
|
492
347
|
|
|
493
|
-
+ (FBCommandStatus *)configureAutoClickAlertWithSelector:(NSString *)selector
|
|
494
|
-
forSession:(FBSession *)session
|
|
495
|
-
{
|
|
496
|
-
if (0 == [selector length]) {
|
|
497
|
-
[FBConfiguration setAutoClickAlertSelector:selector];
|
|
498
|
-
[session disableAlertsMonitor];
|
|
499
|
-
return [FBCommandStatus ok];
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
NSError *error;
|
|
503
|
-
FBClassChain *parsedChain = [FBClassChainQueryParser parseQuery:selector error:&error];
|
|
504
|
-
if (nil == parsedChain) {
|
|
505
|
-
return [FBCommandStatus invalidSelectorErrorWithMessage:error.localizedDescription
|
|
506
|
-
traceback:nil];
|
|
507
|
-
}
|
|
508
|
-
[FBConfiguration setAutoClickAlertSelector:selector];
|
|
509
|
-
[session enableAlertsMonitor];
|
|
510
|
-
return [FBCommandStatus ok];
|
|
511
|
-
}
|
|
512
|
-
|
|
513
348
|
+ (NSString *)buildTimestamp
|
|
514
349
|
{
|
|
515
350
|
return [NSString stringWithFormat:@"%@ %@",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
<key>CFBundlePackageType</key>
|
|
16
16
|
<string>FMWK</string>
|
|
17
17
|
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>13.1
|
|
18
|
+
<string>13.2.1</string>
|
|
19
19
|
<key>CFBundleSignature</key>
|
|
20
20
|
<string>????</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>13.1
|
|
22
|
+
<string>13.2.1</string>
|
|
23
23
|
<key>NSPrincipalClass</key>
|
|
24
24
|
<string/>
|
|
25
25
|
</dict>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
@class FBCommandStatus;
|
|
12
|
+
@class FBSession;
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
@interface FBSettingsHandler : NSObject
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Applies the given settings dictionary to FBConfiguration and the active session.
|
|
20
|
+
* JSON null values are normalized to nil. Nil is applied only for settings that
|
|
21
|
+
* support clearing (e.g. alert action and selectors); other keys are skipped so
|
|
22
|
+
* null does not get coerced to NO/0. Unknown keys are skipped.
|
|
23
|
+
*
|
|
24
|
+
* @return nil on success, or an FBCommandStatus describing the validation error.
|
|
25
|
+
*/
|
|
26
|
+
+ (nullable FBCommandStatus *)applySettings:(NSDictionary *)settings toSession:(FBSession *)session;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns the current values for all known settings.
|
|
30
|
+
*/
|
|
31
|
+
+ (NSDictionary *)currentSettingsForSession:(FBSession *)session;
|
|
32
|
+
|
|
33
|
+
@end
|
|
34
|
+
|
|
35
|
+
NS_ASSUME_NONNULL_END
|