<commit_before>// @flow

const DEFAULT_MAX_ELEMENT_SIZE = 1500000;

const isChrome = () => !!window.chrome && !!window.chrome.webstore;

const isFirefox = () => typeof window.InstallTrigger !== 'undefined';

const isSafari = () =>
  /constructor/i.test(window.HTMLElement) ||
  (p => p.toString() === '[object SafariRemoteNotification]')(
    !window['safari'] ||
      (typeof window.safari !== 'undefined' && window.safari.pushNotification),
  );

const isOpera = () =>
  (!!window.opr && !!window.opr.addons) ||
  !!window.opera ||
  navigator.userAgent.indexOf(' OPR/') >= 0;

const elementSizesPerBrowser = {
  chrome: 33554428,
  safari: 33554428,
  opera: 33554428,
  firefox: 17895696,
};

export const getMaxElementSize = (): number => {
  if (isChrome()) {
    return elementSizesPerBrowser.chrome;
  }
  if (isSafari()) {
    return elementSizesPerBrowser.safari;
  }
  if (isOpera()) {
    return elementSizesPerBrowser.opera;
  }
  if (isFirefox()) {
    return elementSizesPerBrowser.firefox;
  }
  return DEFAULT_MAX_ELEMENT_SIZE;
};
<commit_msg>Backed out max-element size changes for all but Chrome<commit_after>// @flow

const DEFAULT_MAX_ELEMENT_SIZE = 1500000;
const CHROME_MAX_ELEMENT_SIZE = 1.67771e+07;

const isChrome = () => !!window.chrome && !!window.chrome.webstore;

export const getMaxElementSize = (): number => {
  if (isChrome()) {
    return CHROME_MAX_ELEMENT_SIZE;
  }

  return DEFAULT_MAX_ELEMENT_SIZE;
};

{'fraction_non_alphanumeric': 0.15027700831024932, 'fraction_numerical': 0.038088642659279776, 'mean_word_length': 4.371747211895911, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '5918940', 'n_tokens_mistral': 547, 'n_tokens_neox': 511, 'n_words': 96}