Giter Site home page Giter Site logo

openinfirefoxclient's Introduction

Opening links in Firefox for iOS

This open-source project provides support for opening links in Firefox for iOS. There are classes (for Objective-C and Swift), along with a sample project that uses them, available for reference and use.

Using OpenInFirefoxControllerSwift or OpenInFirefoxControllerObjC to open links

The OpenInFirefoxControllerSwift and OpenInFirefoxControllerObjC classes provide methods that handle the making of custom URI schemes, checking if Firefox is installed on the device and opening the URL in Firefox. Callback URL support in the browser UI will be provided in the near future. We have provided Swift and Objective-C implementations of these classes to accommodate your language of choice.

Methods

  • isFirefoxInstalled: returns true if Firefox is installed
  • openInFirefox: opens the specified URL in Firefox; used with or without the following:
  • callbackScheme: the URL to which a callback is sent; you can define your app's custom URI scheme in a class variable called myAppScheme at the top of both class files.

The Custom Firefox URL

Firefox uses a single URI scheme, firefox://. This scheme can accept the following query parameters:

  • url: (required) the URL to open in Firefox.
  • x-source: (optional) the app's custom URI scheme, specified in myAppScheme.
  • x-source-name: (optional; required if x-source is specified) the app name to where the calling app returns; make sure to update your app's CFBundleDisplayName in its Info.plist file or specify a custom name in the class file.

For Example:

  • URL with x-source and x-source-name specified:
firefox://x-callback-url/open/?x-source=firefoxopeninfirefoxclient://&url=https%253A%252F%252Fwww.mozilla.org%252Fen-US%252Fnewsletter%252Fios%252F&x-source-name=OpenInFirefoxClient
  • URL with only url specified:
firefox://open-url?url=https%253A%252F%252Fwww.mozilla.org%252Fen-US%252Fnewsletter%252Fios%252F

Walkthrough

  1. Download the class file in the language of your choice:
  1. Update your app's custom URI scheme for callbacks:
  1. Call methods to open links in Firefox:

Contribute to Firefox for iOS

Learn more about how to contribute to this project: Firefox for iOS official repo

openinfirefoxclient's People

Contributors

bkmunar avatar rnewman avatar

Watchers

 avatar  avatar

Forkers

rnewman

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.