-
Notifications
You must be signed in to change notification settings - Fork 18
How to integrate with modulization introduced by PR #11? #14
Comments
FYI just changing the first and last lines of the file seemed to resolve this issue: 1c1
< var googleDocsUtil = function () {
---
> export default (function () {
446c446
< }();
---
> })(); |
@menicosia my bad, sorry. I'm using webpack to make bundles for my extension, so export module is what I needed. Thank you for feedback. 🙏 |
Ran into the same issue when playing with the tool. I would recommend not relying on a particular build system here (and therefore, rolling back this change). @bdvorianov - you could probably "modularize" it using webpack's custom loaders. |
Consider using my fork of this project - google-docs-utils. So, if you on Node.js, then just: const GoogleDocsUtils = require('google-docs-utils'); If you in browser, then you can inject this script manually and access var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://unpkg.com/google-docs-utils@latest/dist/iife/index.js';
document.head.appendChild(script); |
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:Current behavior:
When I try to load
googleDocsUtil.js
in that way, I get this error from Chrome: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
The text was updated successfully, but these errors were encountered: