Closed caver456 closed 3 years ago
Can't find a compelling reason to get rid of the hardcoded key and id. Hardcodes are ugly, but, removing it would mean that the native host installer would need to determine the extension id after the extension is installed, which could get ugly and would probably be error-prone. Leave the hardcodes for now; this is relevant for publishing the extension since one of the hardcodes is in manifest.json, but could always be updated later.
More reason to leave the hardcode: see https://github.com/ncssar/gpsio/issues/5#issuecomment-958485884 - the ID doesn't change, and is the same for all users - it's just the end of the URL at the extension's page on CWS. So, the hardcode does need to be updated, but, it can remain a hardcode.
Right now, the nmh (native messaging host) manifest file chrome-manifest.json has a hardcoded extension ID in allowed_origins (wildcards are not allowed). This requires use of 'key' in the extension manifest manifest.json so that the extension will have the same ID on every system it is installed on. Not sure if this is really a problem. Maybe it's even desirable...? Investigate removing these hardcodes, such that allowed_origins inside chrome-manifest.json is generated on the fly based on the installed extension ID. Investigate whether the hardcodes >should< be removed.