<commit_before>/* global cordova:false */
/* globals window, document, navigator */

/*!
 * Module dependencies.
 */

var exec = cordova.require('cordova/exec');

/**
 * PushNotification constructor.
 *
 * @param {Object} options to initiate Push Notifications.
 * @return {PushNotification} instance that can be monitored and cancelled.
 */
var serviceWorker, subscription;
var notificationCanceled = false;
var keepChannelAliveTimeout = null;
var PushNotification = function(options) {
    this._handlers = {
        'registration': [],
        'notification': [],
        'notificationclick': [],
        'error': []
    };

    // require options parameter
    if (typeof options === 'undefined') {
        throw new Error('The options argument is required.');
    }

    // store the options to this object instance
    this.options = options;

    // triggered on registration and notification
    var that = this;
    var windowGuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
        return v.toString(16);
    });

    // Add manifest.json to main HTML file
    var linkElement = document.createElement('link');
    linkElement.rel = 'manifest';
    linkElement.href = 'manifest.json';
    document.getElementsByTagName('head')[0].appendChild(linkElement);

    var MAX_RETRIES = 3;

    function installServiceWorker(retry) {
        if (retry <= MAX_RETRIES) {
            if ('serviceWorker' in navigator && 'MessageChannel' in window) {<commit_msg>Manifest URL can be changed for browser platform<commit_after>/* global cordova:false */
/* globals window, document, navigator */

/*!
 * Module dependencies.
 */

var exec = cordova.require('cordova/exec');

/**
 * PushNotification constructor.
 *
 * @param {Object} options to initiate Push Notifications.
 * @return {PushNotification} instance that can be monitored and cancelled.
 */
var serviceWorker, subscription;
var notificationCanceled = false;
var keepChannelAliveTimeout = null;
var PushNotification = function(options) {
    this._handlers = {
        'registration': [],
        'notification': [],
        'notificationclick': [],
        'error': []
    };

    // require options parameter
    if (typeof options === 'undefined') {
        throw new Error('The options argument is required.');
    }

    // store the options to this object instance
    this.options = options;
	this.browserOptions = this.options.browser || {}

    // triggered on registration and notification
    var that = this;
    var windowGuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
        return v.toString(16);
    });

    // Add manifest.json to main HTML file
    var linkElement = document.createElement('link');
    linkElement.rel = 'manifest';
	if (this.browserOptions.manifestUrl) {
		linkElement.href = this.browserOptions.manifestUrl;
	} else {
		linkElement.href = 'manifest.json';
	}
    document.getElementsByTagName('head')[0].appendChild(linkElement);

    var MAX_RETRIES = 3;

    function installServiceWorker(retry) {
        if (retry <= MAX_RETRIES) {
            if ('serviceWorker' in navigator && 'MessageChannel' in window) {
{'fraction_non_alphanumeric': 0.13044794188861986, 'fraction_numerical': 0.007263922518159807, 'mean_word_length': 3.210191082802548, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '192296', 'n_tokens_mistral': 968, 'n_tokens_neox': 922, 'n_words': 256}