...you understand "impossible" behavior of your tests. When you run a Rack::Test (non-Javascript) test with Capybara, there is a single process in play. It runs both your test...

...and the server responding to the user interactions scripted by your test. A Selenium (Javascript) test has a lot more moving parts: One process runs your test script. This is...

You should prefer native promises to jQuery's Deferreds. Native promises are much faster than their jQuery equivalent. Native promises...

If possible your code should detect features, not browsers. But sometimes you just need to sniff the browser. And when...

...know about this. 0. Security considerations Each "like" button is implemented by including a Javascript on your site. This means you are running fucking remote code on your page. You...

...site is suggesting security by operating under HTTPS and you are still loading remote Javascript you are sort of full of shit. Even if you are cool with injecting remote...

...focusable nor visible to screen readers. Alternatives If you're starting your transition from JavaScript, you can give the element the [inert] attribute. This will make the browser ignore input...

...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...

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...

makandra dev

...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...

caniuse.com

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...