animal-crossing-music-extension / ac-music-extension

Google Chrome extension that plays hourly Animal Crossing music and more while browsing!
https://acmusicext.com
zlib License
344 stars 57 forks source link

Add Firefox support #78

Open PikaDude opened 4 years ago

PikaDude commented 4 years ago

Should be pretty easy to do, I managed to get an older build somewhat working.

paladique commented 4 years ago

Out of curiosity I ran a compatibility report on this, here's the results:


{
  "compat": [],
  "errors": [],
  "warnings": [
    {
      "message": "\"storage.sync\" can cause issues when loaded temporarily",
      "description": "This API can cause issues when loaded temporarily using about:debugging in Firefox unless you specify applications|browser_specific_settings > gecko > id in the manifest. Please see: https://mzl.la/2hizK4a for more.",
      "locations": [
        {
          "file": "scripts/background/AudioManager.js",
          "line": 218
        },
        {
          "file": "scripts/background/TownTuneManager.js",
          "line": 20
        },
        {
          "file": "scripts/options/options.js",
          "line": 137
        },
        {
          "file": "scripts/options/options.js",
          "line": 158
        },
        {
          "file": "scripts/options/tune_editor.js",
          "line": 137
        },
        {
          "file": "scripts/options/tune_editor.js",
          "line": 176
        },
        {
          "file": "scripts/options/tune_editor.js",
          "line": 183
        },
        {
          "file": "scripts/options/tune_editor.js",
          "line": 206
        },
        {
          "file": "scripts/background/StateManager.js",
          "line": 88
        },
        {
          "file": "scripts/background/StateManager.js",
          "line": 215
        }
      ]
    },
    {
      "message": "Unsafe assignment to innerHTML",
      "description": "Due to both security and performance concerns, this may not be set using dynamic values which have not been adequately sanitized. This can lead to security issues or fairly serious performance degradation.",
      "locations": [
        {
          "file": "scripts/options/options.js",
          "line": 54
        },
        {
          "file": "scripts/options/options.js",
          "line": 59
        },
        {
          "file": "scripts/options/options.js",
          "line": 177
        },
        {
          "file": "scripts/options/options.js",
          "line": 188
        },
        {
          "file": "scripts/options/zepto.min.js",
          "line": 2
        }
      ]
    },
    {
      "message": "eval can be harmful.",
      "description": "Evaluation of strings as code can lead to security vulnerabilities and performance issues, even in the most innocuous of circumstances. Please avoid using `eval` and the `Function` constructor when at all possible.'",
      "locations": [
        {
          "file": "scripts/options/zepto.min.js",
          "line": 2
        },
        {
          "file": "scripts/options/zepto.min.js",
          "line": 2
        }
      ]
    }
  ]
}
paladique commented 4 years ago

Looks like the storage.sync warning was the most important of these to get the music to start. These other warnings should probably be addressed at some point too.

unixfox commented 4 years ago

Just to see what would break, I tried to load the extension into Firefox and here are the logs:

can't access property "enableBadgeText", options is undefined StateManager.js:36
    activate moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/StateManager.js:36
    getSyncedOptions moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/StateManager.js:109
    apply self-hosted:1871
    applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:614
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:843
    withLastError resource://gre/modules/ExtensionCommon.jsm:762
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:831
    (Async: promise callback)
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:813
    callAsyncFunction resource://gre/modules/ExtensionCommon.jsm:1091
    callAsyncFunction resource://gre/modules/ExtensionChild.jsm:1199
    callAndLog resource://gre/modules/ExtensionChild.jsm:1175
    callAsyncFunction resource://gre/modules/ExtensionChild.jsm:1198
    stub resource://gre/modules/Schemas.jsm:2679
    getSyncedOptions moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/StateManager.js:88
    activate moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/StateManager.js:35
    <anonymous> moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/main.js:13
    <anonymous> moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/main.js:15

Unchecked lastError value: Error: The storage API will not work with a temporary addon ID. Please add an explicit addon ID to your manifest. For more information see https://bugzil.la/1323228. StateManager.js:88
    getSyncedOptions moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/StateManager.js:88

TypeError: can't access property "enableBackground", options is undefined2 StateManager.js:224:7
    checkTabs moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/StateManager.js:224
    (Async: setInterval handler)
    StateManager moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/StateManager.js:202
    <anonymous> moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/main.js:5
    <anonymous> moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/main.js:15

can't access property "enableBackground", options is undefined StateManager.js:224
    checkTabs moz-extension://5e4434c8-4da5-4223-a019-c6364d2e5983/scripts/background/StateManager.js:224
    apply self-hosted:1871
    applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:614
    fire resource://gre/modules/ExtensionChild.jsm:1284
    recvRunListener resource://gre/modules/ExtensionChild.jsm:1288
    recvRunListener self-hosted:877
    _recv resource://gre/modules/ConduitsChild.jsm:78
    receiveMessage resource://gre/modules/ConduitsChild.jsm:169
    (Async: JSWindowActor query)
    _send resource://gre/modules/ConduitsChild.jsm:61
    _send resource://gre/modules/ConduitsParent.jsm:206
    _send self-hosted:978
    listener resource://gre/modules/ExtensionParent.jsm:1149
    apply self-hosted:1871
    applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:614
    applySafe resource://gre/modules/ExtensionParent.jsm:756
    async resource://gre/modules/ExtensionCommon.jsm:2438
    (Async: promise callback)
    async resource://gre/modules/ExtensionCommon.jsm:2436
    listener chrome://browser/content/parent/ext-tabs.js:563
    listener2 chrome://browser/content/parent/ext-tabs.js:461
    emit resource://gre/modules/ExtensionCommon.jsm:327
    emitCreated chrome://browser/content/parent/ext-browser.js:715
    handleEvent chrome://browser/content/parent/ext-browser.js:559

And clicking on the icon of the extension does nothing: image

Velkas commented 2 years ago

Any life in this? Would like to have it on my machines that use firefox, since chrome is a no-go for them.

PlexSheep commented 1 year ago

I still want this