Rob--W / cookie-manager

Cookie Manager for Firefox (Desktop/Android), Chrome. Supports viewing and editing of cookies and private cookies.
Mozilla Public License 2.0
105 stars 24 forks source link

Chrome error when activated #25

Open CollinChaffin opened 5 years ago

CollinChaffin commented 5 years ago

I know you haven't posted to the Chrome store, but since everything states Chrome compatible as a DEV obviously can still load/use. Was wondering the purpose of this:

ake-api-snippet.js:79 (anonymous function)

if (window.chrome && window.chrome.cookies) {
    throw new Error('Do not load fake-api-snippet.js in an extension!');
}

Everything seems to function perfectly in Chrome and I love extensions and efforts like this! I only ask since it installs by default in error trap mode enabled (I can simply disable to make this ugly error disappear but would rather not have to) it's a bit annoying to see it immediately throwing this dummy error. :)

snag_1-12-2019_11-19-29

Rob--W commented 5 years ago

The extension was originally written for direct use in Chrome (loading the repo itself as an extension at chrome://extensions or --load-extension= flag). Later I added support for running it directly from a file server (without other changes) to make testing on mobile easier (because Firefox for Android supports extensions).

The warning is not causing any loss of functionality, and since I haven't published the Chrome extension yet, I haven't made this a very high priority either. The build script acknowledges this issue though: https://github.com/Rob--W/cookie-manager/blob/31220b31754598cebe4d4754a044569c763437fa/Makefile#L12

If you want to load it as an extension without more complicated build steps, I suggest that you truncate the contents of fake-api-snippet.js.