Skip to content

Chrome extension Service worker "ReferenceError : XMLHttpRequest is not defined" Using firebase storage  #8149

@CarrizalViaro

Description

@CarrizalViaro

Operating System

Windows 11

Browser Version

Chrome/123.0.0.0

Firebase SDK Version

10.10.0

Firebase SDK Product:

Storage

Describe your project's tooling

It is an extension supervises exams and monitors the camera and desktop. It then uploads images to Firebase storage.

The extension is useful for:

  • Proctors who need to monitor students during exams
  • Teachers who want to prevent cheating
  • Anyone who wants to keep an eye on their computer activity

The extension has the following features:

  • It can take screenshots of the user's desktop
  • It can record video of the user's webcam

Describe the problem

When I try to use the uploadString method, I get an error with this message:
"Uncaught ReferenceError: XMLHttpRequest is not defined URL: https://www.gstatic.com/firebasejs/10.10.0/firebase-storage.js"

Steps and code to reproduce issue

This is my relevant code inside of service worker:

import {initializeApp, getApp, getApps, deleteApp} from 'https://www.gstatic.com/firebasejs/10.10.0/firebase-app.js';
import { getStorage, ref, uploadString } from 'https://www.gstatic.com/firebasejs/10.10.0/firebase-storage.js';

const fileRef = ref(storage_fb, "imagenes/" + _current_session_id + "/" + media_data.name + ".jpg");

uploadString(fileRef, media_data.img_data, 'data_url')
  .then((snapshot) => {
      // do something
  })
  .catch((error) => {
      console.log(error);...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions