<commit_before>import fullscreen from 'fullscreen-polyfill';
import globalStore from '../util/globalstore.jsx';
import keys from '../util/keys.jsx';

try {
    globalStore.storeData(keys.gui.global.isFullScreen,!!document.fullscreenElement);
    document.addEventListener('fullscreenchange', () => {
        globalStore.storeData(keys.gui.global.isFullScreen,!!document.fullscreenElement);
    });

}catch (e){
    console.log("unable to install fullscreen handler")
}


const toggleFullscreen=()=>{
    let element=document.fullscreenElement;
    if (! element) {
        document.body.requestFullscreen();
    }
    else{
        document.exitFullscreen();
    }
};

const fullScreenAvailable=()=>{
   return !!document.fullscreenEnabled
}<commit_msg>disable fullscreen for chrome < 44<commit_after>import fullscreen from 'fullscreen-polyfill';
import globalStore from '../util/globalstore.jsx';
import keys from '../util/keys.jsx';

let fullScreenBlocked=false;
let userAgent=navigator.userAgent;
//it seems that fullscreen does not work on older android versions (at least tested to work since 6/chrome44)
if (userAgent.match(/Chrome/)){
    let chromeVersion=userAgent.replace(/.*Chrome[/]*/,'').replace(/ .*/,'');
    if (chromeVersion){
        chromeVersion=chromeVersion.replace(/\..*/,'');
        if (chromeVersion < 44){
            fullScreenBlocked=true;
        }
    }
}

try {
    globalStore.storeData(keys.gui.global.isFullScreen,! fullScreenBlocked && !!document.fullscreenElement);
    if (! fullScreenBlocked) {
        document.addEventListener('fullscreenchange', () => {
            globalStore.storeData(keys.gui.global.isFullScreen, !!document.fullscreenElement);
        });
    }

}catch (e){
    console.log("unable to install fullscreen handler")
}


const toggleFullscreen=()=>{
    if (! fullScreenAvailable()) return;
    let element=document.fullscreenElement;
    if (! element) {
        document.body.requestFullscreen();
    }
    else{
        document.exitFullscreen();
    }
};

const fullScreenAvailable=()=>{
   return ! fullScreenBlocked && !!document.fullscreenEnabled
}
{'fraction_non_alphanumeric': 0.14177693761814744, 'fraction_numerical': 0.0033081285444234404, 'mean_word_length': 3.800453514739229, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7198244', 'n_tokens_mistral': 620, 'n_tokens_neox': 606, 'n_words': 118}