See https://bugzilla.mozilla.org/show_bug.cgi?id=1735738 for reference.
}
              task.pdfDoc = doc;
              task.optionalContentConfigPromise =
                doc.getOptionalContentConfig();
              if (task.optionalContent) {
                const entries = Object.entries(task.optionalContent),
                  optionalContentConfig =
                    await task.optionalContentConfigPromise;
                for (const [id, visible] of entries) {
                  optionalContentConfig.setVisibility(id, visible);
                }
              }
              this._nextPage(task, failure);
            },
            err => {
              failure = "Loading PDF document: " + err;
              this._nextPage(task, failure);
            }
          );
          return;
        } catch (e) {
          failure = "Loading PDF document: " + this._exceptionToString(e);
        }
        this._nextPage(task, failure);
      });
    },
    _cleanup() {
      
      while (document.styleSheets.length > 0) {
        const styleSheet = document.styleSheets[0];