<commit_before>/*! This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */


"use strict";

var triggers = require("./triggers");
var logger = require("./logger");
var button = require("./ui/button");
var info = require("./generalInfo");
var featuredata = require("./featuredata");
var {WindowTracker} = require("sdk/deprecated/window-utils");
var {isBrowser} = require("sdk/window/utils");
var config = require("./config");
var ui = require("./ui")

const REASON = [ 'unknown', 'startup', 'shutdown', 'enable', 'disable',
'install', 'uninstall', 'upgrade', 'downgrade' ];

function firstRun(){
	logger.log("Running for the first time...");
	info.registerFirstTimePrefs();
	info.sendInstallInfo();

	//setting the default notification
	info.setDefaultNotification();
	
}



//start listening when button is clicked
var main = exports.main = function (options, callbacks){
	
	// startButton.icon = {"16": "./ui/icons/lightbulb_gr.png"};

	//check if this is the first time 
	if (info.isThisFirstTime())
		firstRun();

	//start triggers
	triggers.init();
}

<commit_msg>selfuninstaller merge<commit_after>/*! This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */


"use strict";

const STUDYLIFETIME = 7 * 86400 * 1000;  // microseconds

var triggers = require("./triggers");
var logger = require("./logger");
var button = require("./ui/button");
var info = require("./generalInfo");
var featuredata = require("./featuredata");
var {WindowTracker} = require("sdk/deprecated/window-utils");
var {isBrowser} = require("sdk/window/utils");
var config = require("./config");
var ui = require("./ui")

const REASON = [ 'unknown', 'startup', 'shutdown', 'enable', 'disable',
'install', 'uninstall', 'upgrade', 'downgrade' ];

function firstRun(){
	logger.log("Running for the first time...");
	info.registerFirstTimePrefs();
	info.sendInstallInfo();

	//setting the default notification
	info.setDefaultNotification();
	
}



//start listening when button is clicked
var main = exports.main = function (options, callbacks){
	
	// startButton.icon = {"16": "./ui/icons/lightbulb_gr.png"};

	//check if this is the first time 
	if (info.isThisFirstTime())
		firstRun();

	// death timer, re #71. backstopped by addon update to 'dead' addon.
	if (Date.now() - info.getStartDate() >= STUDYLIFETIME) {
		require("sdk/addon/installer").uninstall(require("self").id);
	};

	//start triggers
	triggers.init();
}


{'fraction_non_alphanumeric': 0.1674712216858522, 'fraction_numerical': 0.008911994058670627, 'mean_word_length': 4.26171875, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '738643', 'n_tokens_mistral': 874, 'n_tokens_neox': 823, 'n_words': 257}