Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

How to integrate with modulization introduced by PR #11? #14

Open
@menicosia

Description

@menicosia

Hello! I am trying to take advantage of the improvements in recent PRs, but I am blocked by the change introduced by PR #11 where the main file was transformed into a module.

Previous behavior:

  • Load googleDocsUtil.js via the extension's manifest.json:

    "content_scripts": [
       {
         "js": ["googleDocsUtil.js", "receiver.js"],
    

Current behavior:

  • When I try to load googleDocsUtil.js in that way, I get this error from Chrome:

    googleDocsUtil.js:1
    Uncaught SyntaxError: Unexpected token 'export'

As a result of this change, I don't know how to access the module from within a Chrome extension. Specifically, I need googleDocsUtil.js to load into the page that I am currently viewing, and the only way I know how to do that is via a content script, which does not accept a Javascript module. There is no way to import or require the file because, without this content script loading, the file is not available to my extension.

Since I am stuck, the only change I can think to suggest is to roll-back the module-ness of PR #11? Are there other options?

/cc @bdvorianov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions