How to use the current-device.default function in current-device

To help you get started, we’ve selected a few current-device examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github caiobiodere / cordova-template-framework7-vue-webpack / template_src / webpack / dev_helpers / CordovaDeviceRouter.js View on Github external
const deviceJs = require('current-device').default;

function bodyPrepend(platform) {
  let body = document.querySelector("body"),
    script = document.createElement("script");

  script.onload = function () {
    console.log("Cordova script loaded!");
  };

  script.src = `platform_cordova_files/${platform}/cordova.js`;
  body.appendChild(script);


  console.log(`${platform} platform cordova.js injected.`);
}

current-device

The easiest way to write conditional CSS and/or JavaScript based on device operating system (iOS, Android, Blackberry, Windows, Firefox OS, MeeGo, AppleTV, etc), orientation (Portrait vs. Landscape), and type (Tablet vs. Mobile).

MIT
Latest version published 3 years ago

Package Health Score

64 / 100
Full package analysis

Similar packages