Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello
📝 Description
First attempt to fix the issues 657
✏️ Modifications
In the previous version, inside the added OCR command function, we call again this function from the browser, so the code loop as reported in issue 657. Now OCR functions are called directly with secured context.
No more
#addCommandsToBrowser
and#extendMultiremoteBrowser
only one clearaddCommand
inside the before function.Inside the added OCR command function, it will no longer provide all browsers/instances from capabilities if the function is called by a single instance (if
isMultiremote
isundefined
), in this case, only the calling browser/instance will call the OCR function requested.Some fix in
update.packages.mjs
to please esLint🔗 Link with other issues
The solution provided for ocr-service to target only the calling browser/instance should be reproduce on the other repository to fix for example issue 983.
🔎 Real problem
According to my understanding, we never go through the change done in PR 13904 so I don't know if it's useful.
In the best solution, we don't need to loop to each instance to add command because it's already done by:
@wdio\utils\build\index.js
line 388 loop:The problem is, if we don't getData will fail on getBase64ScreenshotSize because screenshot will be an array of screenshot instead of one screenshot:
Error: RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
I'm not a javascript/typescript expert so maybe:
But at least it work with both calls from
Browser
orMultiRemoteBrowser
and no longer loop.Best regard,
Paul