<commit_before>/**
*  BrowserNotif.JS
*  (c) 2016 <NAME>
*
*  Lets a web page send notifications that are displayed outside the page at the system level. 
*  This lets web apps send information to a user even if the application is idle, in the background, switched tabs or moved to a different app.
*  For details, see the web site: https://github.com/ipanardian/browser-notif
*  The MIT License
*
*  This is ServiceWorkerApi script
*/

console.log('Started');
self.addEventListener('install', function(event) {
  self.skipWaiting();
  console.log('Installed');
});
self.addEventListener('activate', function(event) {
  console.log('Activated');
});
self.onnotificationclick = function(event) {
    if (typeof event.notification.data != 'null') {
      try {
        var data = JSON.parse(event.notification.data)
      } catch (error) {
        throw new Error('BrowserNotif: Error parse '+ error)
      }
      try {
        if (data !== null && !data.clickOnServiceWorker) {
          Function("(" +data['clickOnServiceWorker']+ ")()")()   
        }
      } catch (error) {
        throw new Error('BrowserNotif: Error clickOnServiceWorker '+ error)
      }<commit_msg>Fixed checking<commit_after>/**
*  BrowserNotif.JS
*  (c) 2016 <NAME>
*
*  Lets a web page send notifications that are displayed outside the page at the system level. 
*  This lets web apps send information to a user even if the application is idle, in the background, switched tabs or moved to a different app.
*  For details, see the web site: https://github.com/ipanardian/browser-notif
*  The MIT License
*
*  This is ServiceWorkerApi script
*/

console.log('Started');
self.addEventListener('install', function(event) {
  self.skipWaiting();
  console.log('Installed');
});
self.addEventListener('activate', function(event) {
  console.log('Activated');
});
self.onnotificationclick = function(event) {
    if (typeof event.notification.data != 'null') {
      try {
        var data = JSON.parse(event.notification.data)
      } catch (error) {
        throw new Error('BrowserNotif: Error parse '+ error)
      }
      try {
        if (data !== null && data.clickOnServiceWorker !== undefined) {
          Function("(" +data['clickOnServiceWorker']+ ")()")()   
        }
      } catch (error) {
        throw new Error('BrowserNotif: Error clickOnServiceWorker '+ error)
      }
{'fraction_non_alphanumeric': 0.12966101694915255, 'fraction_numerical': 0.003389830508474576, 'mean_word_length': 3.3884758364312266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3562370', 'n_tokens_mistral': 691, 'n_tokens_neox': 671, 'n_words': 206}