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

Remove dependency on JQuery for hiding the caret #24

Merged
merged 2 commits into from
Nov 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/capybara/screenshot/diff/stabilization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ def prepare_page_for_screenshot(timeout:)
JS
blurred_input = page.driver.send :unwrap_script_result, active_element
end
execute_script("$('*').css('caret-color','transparent')") if Capybara::Screenshot.hide_caret
hide_caret = <<~SCRIPT
var style = document.createElement('style');
document.head.appendChild(style);
var styleSheet = style.sheet;
styleSheet.insertRule("* { caret-color: transparent !important; }", 0);
SCRIPT
execute_script(hide_caret) if Capybara::Screenshot.hide_caret
donv marked this conversation as resolved.
Show resolved Hide resolved
blurred_input
end

Expand Down