@angular/platform-browser vs. @angular/platform-browser-dynamic

The difference between platform-browser-dynamic and platform-browser is the way your Angular app will be compiled. Using the dynamic platform makes Angular send the just-in-time compiler to the front-end along with your application. Which means your application is being compiled client-side. On the other hand, using platform-browser leads to an ahead-of-time pre-compiled version of your application … Read more

In Cypress, set a token in localStorage before test

Here’s an example of adding a command cy.login() that you can use in any Cypress test, or put in a beforeEach hook. Cypress.Commands.add(‘login’, () => { cy.request({ method: ‘POST’, url: ‘http://localhost:3000/api/users/login’, body: { user: { email: ‘jake@jake.jake’, password: ‘jakejake’, } } }) .then((resp) => { window.localStorage.setItem(‘jwt’, resp.body.user.token) }) }) Then in your test: beforeEach(() => … Read more

Cross-Browser Extensions API?

Yes, but unfortunately each one has significant drawbacks. Kynetx supports IE, Firefox, Safari, and Chrome, but extensions are dependent on the Kynetx extension to work. In addition, Kynetx apps are built using an odd, proprietary Kynetx Rules Language. There is no cost to use the Kynetx platform. UPDATE: Kynetx has shut down WebMynd supports IE, … Read more

How does HTML5 Geolocation Work?

First, an amazing demo Try this in Chrome. How it works Here is your answer. Click on “How Google Chrome determines your location”. From that page: If you allow Google Chrome to share your location with a site, the browser will send local network information to Google Location Services to get an estimate of your … Read more

JavaFX – can it really be deployed in a browser? [closed]

Update for the March 2018 Java Client Roadmap I encourage readers interested in this question to review the following Oracle Whitepaper: Java Client Roadmap Update The above paper outlines the official Oracle position on related technologies (JavaFX/Swing/AWT/Applets/WebStart), the dates until which it intends to support those technologies and which of those technologies it intends to … Read more

How to use a custom time in browser to test for client vs server time difference

Create a new empty directory for a separate Chrome user profile. E.g. with mkdir ~/chrome-profile You specify the TZ environment variable. You can see the valid timezones for example here, in column TZ. To start Chrome, use these commands: for Mac OS X: TZ=’US/Pacific’ open -na “Google Chrome” –args “–user-data-dir=$HOME/chrome-profile” for Linux: TZ=’US/Pacific’ google-chrome “–user-data-dir=$HOME/chrome-profile”

tech