onassar / Safari-ExtensionState

Provides helper class for managing Safari Extension installed and updated events.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SafariExtensionState

Usage

Below is an example of how to call the SafariExtensionState class. You'd likely make the below call from within your global.html file, so that after an install or update action, your code is triggered.

SafariExtensionState.installed(function(version) {
    console.log('(global.html): Installed');
    var tab = safari.application.activeBrowserWindow.openTab(),
        url = 'https://website.com/safari/extension/installed';
    tab.url = url;
});
SafariExtensionState.updated(function(version) {
    console.log('(global.html): Updated');
});

About

Provides helper class for managing Safari Extension installed and updated events.

License:MIT License


Languages

Language:JavaScript 100.0%