code: function fixWebcomponentsElement (element) {
    if (typeof window.ShadowDOMPolyfill !== 'undefined') {
  
      const is_native = document.defaultView.getComputedStyle
        .toString().indexOf('[native code]') !== -1;
  
      // Can't check if element is instance of HTMLElement, because the polyfill
      // hijacks this. Only reliable way of checking if it is wrapped I found
      // is using this ugly ass property.
      const is_wrapped = typeof element.__impl4cf1e782hg__ !== 'undefined';
  
      if (is_native && is_wrapped) {
        element = window.ShadowDOMPolyfill.unwrap(element);
      }
  
      if (!is_native && !is_wrapped) {
        element = window.ShadowDOMPolyfill.wrap(element);
      }
    }
  
    return element;
  }
docs: @typedef {Object} StyleProperty
  @property {string} unit - unit of the property, e.g. px, rgb
  @property {string|number} value - value of the property
  @property {string} output - valid string representation of value and unit
  
  @example <caption>Simple property.</caption>
  {
  unit: 'px',
  value: 100,
  output: '100px'
  }
  
  @example <caption>Color property.</caption>
  {
  unit: 'rgb',
  value: [255, 255, 255],
  output: '#ffffff'
  }
   
  Attempts to fix the element when using Webcomponents with ShadowDOMPolyfill. It returns either original element or wrapped element, depending on whether the polyfill replaced the original `getComputedStyle` method or not.
  This is madness and no sane person should ever do hacks like this. ShadowDOMPolyfill sucks donkey balls!
  @param {Object|HTMLElement} element
  @returns {Object|HTMLElement}