GithubHelp home page GithubHelp logo

deniskutovskiy / browserwindow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from githubcatw/browserwindow

0.0 0.0 0.0 3 MB

Library for opening web browser windows on various platforms from Unity.

License: MIT License

C 1.06% C# 76.61% Kotlin 13.91% Objective-C++ 4.58% Swift 3.85%

browserwindow's Introduction

Browser Window

Library for opening web browser windows on various platforms from Unity.

Installation

This repository is a Unity package. Add it as a Git package to your project from the Package Manager.

If you plan to develop for Android, install Google's External Dependency Manager and resolve Android packages to install the native dependencies.

Usage

Simply call BrowserWindow.Open to open a URL:

string repo = "https://github.com/githubcatw/BrowserWindow";
BrowserWindow.Open(repo);

You can also check out the wiki for full documentation. If you prefer learning by example or want to look at an example of usage check out the Basic Sample provided with the package.

Customization

Browser windows can be customized, with different settings depending on the platform. For this an object with the class BrowserWindow needs to be created, as well as a platform-specific configuration.

Here's an example for changing colors of Chrome custom tabs on Android:

// Create an Android configuration
BWAndroidConfig androidConfig = new BWAndroidConfig();
// Set the color of the window to blue
androidConfig.SetColor(Color.blue);
// Create a BrowserWindow object and set the Android config
BrowserWindow window = new BrowserWindow();
window.SetAndroidConfig(androidConfig);

After that it's as simple as calling CustomOpen on the object to open a URL with the preferred settings:

string repo = "https://github.com/githubcatw/BrowserWindow";
window.CustomOpen(repo);

In this example, the code above will launch a blue custom tab pointing to this repository on Android, and a regular browser window on other platforms.

For more information about customization check out the wiki page on platform specific customization.

FAQ

Q. What platforms are supported?

A. Currently the library supports:

  • Chrome custom tabs on Android,
  • SFSafariViewController on iOS,
  • Unity's Application.OpenURL method on other platforms.

Q. When using ProGuard there is a missing plugin error!

A. Enable the custom proguard-user file if it's off, and add this to Plugins/Android/proguard-user.txt:

-keep public class dev.torosyan.** { *; }

Q. Are there any licensing restrictions?

A. Browser Window is licensed under the MIT license, meaning that you can use it in a closed source project. If you make changes and think that other developers might like them too, feel free to contribute.

browserwindow's People

Contributors

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