content-thunk.js 759 B

123456789101112131415161718192021222324
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. function handleVideoDetect(message)
  5. {
  6. let isVideo = false;
  7. let fsEl = content.document.mozFullScreenElement;
  8. if(fsEl)
  9. {
  10. isVideo = (
  11. fsEl.nodeName == "VIDEO"
  12. || (fsEl.nodeName == "IFRAME" && fsEl.contentDocument && fsEl.contentDocument.getElementsByTagName("VIDEO").length > 0)
  13. || fsEl.getElementsByTagName("VIDEO").length > 0
  14. );
  15. }
  16. sendAsyncMessage("status4evar@caligonstudios.com:video-detect-answer", {isVideo: isVideo});
  17. }
  18. addMessageListener("status4evar@caligonstudios.com:video-detect", handleVideoDetect);