Giter Site home page Giter Site logo

samnan / cordova-plugin-useragent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ninarock/cordova-plugin-useragent

0.0 1.0 0.0 16 KB

Allows you to change your User-Agent for HTTP requests.

Java 52.10% Objective-C 33.79% JavaScript 14.12%

cordova-plugin-useragent's Introduction

Cordova/PhoneGap UserAgent Plugin

Plugin for Cordova 3.0+ that allows you to change your User-Agent for HTTP requests.

Check your user agent

https://www.whoishostingthis.com/tools/user-agent/

Change User-agent with caution!

Starting from Build.VERSION_CODES.KITKAT Android version, changing the user-agent while loading a web page causes WebView to initiate loading once again. https://developer.android.com/reference/android/webkit/WebSettings#setUserAgentString(java.lang.String)

Related question from stackoverflow

https://stackoverflow.com/questions/62434410/set-user-agent-in-webview-for-android-api-30/62535531

Actual info

According to https://www.infoq.com/news/2020/03/chrome-phasing-user-agent/, Chrome will replace User-Agent with a new API called Client Hints.


Adding the plugin to your project

To install the plugin, use the Cordova CLI and enter the following:
cordova plugin add https://github.com/LouisT/cordova-useragent

Platforms

Use

To set your User-Agent:
UserAgent.set(useragent)

To get your current User-Agent:
UserAgent.get(function(ua) { })

To set your User-Agent back to the default:
UserAgent.reset()

cordova-plugin-useragent's People

Contributors

danielsogl avatar giorgionatili avatar jonas-m- avatar louist avatar ninarock avatar samnan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.