Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RUMF-1045] rely on browser detection to check for innerText support #1110

Merged
merged 4 commits into from
Oct 6, 2021

Conversation

BenoitZugmeyer
Copy link
Member

Motivation

The current solution to check for innerText accuracy (to see if it correctly removes style and script text content for computing action names) triggers CSP warnings.

Changes

To avoid CSP warning, simply rely on browser detection.

Testing

CI


I have gone over the contributing documentation.

@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner October 5, 2021 10:40
Comment on lines +1 to +3
export function isIE() {
return Boolean((document as any).documentMode)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use this function for spec as well?
it could be nice to have a single isIE function in the code base

@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner October 6, 2021 08:24
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2021

Codecov Report

Merging #1110 (5fe5ad6) into main (4cb949c) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1110      +/-   ##
==========================================
- Coverage   88.22%   88.21%   -0.02%     
==========================================
  Files          92       93       +1     
  Lines        4281     4275       -6     
  Branches      984      983       -1     
==========================================
- Hits         3777     3771       -6     
  Misses        504      504              
Impacted Files Coverage Δ
packages/core/src/tools/browserDetection.ts 100.00% <100.00%> (ø)
...ventsCollection/action/getActionNameFromElement.ts 86.27% <100.00%> (-1.00%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4cb949c...5fe5ad6. Read the comment docs.

@bcaudan bcaudan merged commit 07da76d into main Oct 6, 2021
@bcaudan bcaudan deleted the benoit/avoid-csp-warnings-when-computing-action-name branch October 6, 2021 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants