...security vulnerabilities. The dependencies of your apps are Ruby, Rails, all other gems and JavaScript libraries. Find out what a CVE advisory is. Understand how we're dealing with security...
...query parameter ordering 1 URI ignoring query parameter ordering 2 Tests with AJAX Using javascript in integration tests might cause issues that AJAX requests are not recorded or bleed in...
...called a consent management platform (CMP). Your website will load this CMP via a JavaScript tag which will then directly render the form. The form will show the user detailed...
...See https://www.consentstringdecoder.com/ for an example string. The CMP will even inject a standardized JavaScript function called __tcfapi into your website. This can be used by any other third-party...
...Add a new link to your browser's bookmarks bar with the following URL. javascript:(() => { if (document.querySelector('[data-view-id="issue-view"]')) { const [id, ...words] = document.title.split(' ') ; prompt('Commit message:', `[${id...
...properly, with modern CSS features In the past, you might have resorted to bulky JavaScript solutions or CSS hacks like transitioning between max-height: 0 and max-height: 9999px. All...
...a monkey-patch for Capybara::Node::Element#click that will use the Element#scrollIntoViewIfNeeded JavaScript function before clicking any element: Capybara::Node::Element.prepend(Module.new do def click(*keys, **options)
...the GA snippet into more than one website, maybe you've even used its Javascript API to implement tracking at the event level. Google Tag Manager (GTM) is a related...
...GTM (which makes GTM a huge XSS machine, actually). This goes even beyond injecting Javascript snippets and tracking page views. Even event tracking can be modeled inside GTM, using a...
Resources RubyGuides: Mastering Ruby Regular Expressions Using regular expressions in JavaScript Testing regular expressions visually Regular Expressions: Quantifier modes Ruby: You can nest regular expressions Matching line feeds with...
testing-library are widely used testing utilities libraries for javascript dependent frontend testing. The main utilities provided are query methods, user interactions, dom expectations and interacting with components of several...
...from the toolbar. For that, you should listen to the trix-initialize event in javascript. addEventListener("trix-initialize", event => { const { toolbarElement } = event.target const textTools = toolbarElement.querySelector("[data-trix-button-group=text...
...starred / movie is unstarred) is rendered by the server or by the client (using JavaScript). Try not to duplicate rendering logic or persistance logic though. Is this a good way...
All major browsers (IE8+, FF3.5+, Safari 4+, any Chrome) support sessionStorage, a JavaScript storage object that survives page reloads and browser restores, but is different per new tab/window (in contrast...
...except that it returns all types of child nodes) Filter manually using either plain Javascript or jQuery's filter() method Example Let's write a function that takes a jQuery...
...local development where you might still use http://. If you set any cookies from JavaScript, this isn't fixed by the middleware. Add this to lib/middleware/secure_cookies.rb: # On HTTPS requests, we...
...application from Sprockets to Webpack(er), you can either transpile your CoffeeScript files to JavaScript or integrate a CoffeeScript compiler to your new process. This checklist can be used to...
...is never reached. Note that this is not quite the same as "hoisting" in JavaScript. The variable is not available in the whole block, just in lines after its declaration...
If you use Cucumber for integration testing, wrap that into something like Before('@javascript') {...
Benefits of using device metrics are: You can configure any device resultion and are not...
...be able to click and drag to scroll), or resort to some kind of JavaScript solution...
...explained in this card. It will prevent attackers from reading your cookies by malicious Javascript and prevent the user's browser from sending it over insecure HTTP connections. Generally: prefer...
...regex editors that help you by highlighting matching text and capture groups: Ruby: Rubular Javascript: RegExr Regular expression visualizer using railroad diagrams
Plot graphs in Ruby WebGraphviz renders in your browser via JavaScript (to store the rendered graph, extract the SVG using your browser's DOM inspector) GraphViz with DOT: Online...
...want to reference a card from a different deck, this bookmarklet might be useful: javascript:(function () { const doAlert = () => { alert("Maybe not a makandra card?") }; let cardsPathPattern = /(\/[\w-]+\/\d+)-.+/; if (window.location.pathname.match...
...that inherits from StandardError. A fun read is Ninja code (even though it's Javascript...
...emulation file below. Problems and Solutions while upgrade capybara and cucumber problems with capybara javascript emulation Remove the following line from your features/support/env.rb file if present. require 'cucumber/rails/capybara_javascript_emulation'
...still have problems with teh capybara javascript emulation, please download capybara_javascript_emulation.rb to features/support/. undefined method click' for class Capybara::Driver::RackTest::Node' (NameError) Capybara::Driver::RackTest namespace moved to Capybara...