Skip to content

Commit

Permalink
Fix Cross Browser Permissions (#20)
Browse files Browse the repository at this point in the history
* Fix Cross Browser Permissions

* Update README.md
  • Loading branch information
smashedr authored May 19, 2024
1 parent d71d1ea commit da73051
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ All **Chromium** Based Browsers can install the extension from the
* Easily Play Narrative as Text to Speech
* Search Registration/Operator from Selection Text
* Search Registration/Operator from Popup Action
* Auto Fill New Incidents for US and Canada Registration

### Upcoming Features and Ideas

* Auto Fill for New Event Submissions
* Infinite Scroll when Browsing Incidents

> [!TIP]
> **Don't see your feature here?**
Expand Down
4 changes: 4 additions & 0 deletions manifest-chrome.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"optional_host_permissions": [
"*://registry.faa.gov/AircraftInquiry/Search/*",
"*://wwwapps.tc.gc.ca/saf-sec-sur/2/ccarcs-riacc/*"
],
"background": {
"service_worker": "js/service-worker.js"
},
Expand Down
4 changes: 4 additions & 0 deletions manifest-firefox.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"optional_permissions": [
"*://registry.faa.gov/AircraftInquiry/Search/*",
"*://wwwapps.tc.gc.ca/saf-sec-sur/2/ccarcs-riacc/*"
],
"background": {
"scripts": ["js/service-worker.js"]
},
Expand Down
4 changes: 0 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
},
"permissions": ["contextMenus", "scripting", "storage"],
"host_permissions": ["*://*.aviation-safety.net/*"],
"optional_permissions": [
"*://registry.faa.gov/AircraftInquiry/Search/*",
"*://wwwapps.tc.gc.ca/saf-sec-sur/2/ccarcs-riacc/*"
],
"content_scripts": [
{
"matches": ["*://*.aviation-safety.net/*"],
Expand Down
2 changes: 1 addition & 1 deletion src/js/asn.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ async function enableAUtoFill(options) {
const extraPerms = await chrome.runtime.sendMessage('extraPerms')
console.log('extraPerms', extraPerms)
if (!extraPerms) {
console.warn('MISSING EXTRA PERMISSIONS')
console.debug('Missing Extra Permissions')

const p = document.createElement('p')
p.textContent =
Expand Down
3 changes: 3 additions & 0 deletions src/js/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export async function checkPerms() {

function updatePermsEl(hasPerms, has, grant) {
console.debug('updatePermsEl:', hasPerms, has, grant)
if (typeof document === 'undefined') {
return console.debug('document undefined')
}
const hasEl = document.querySelectorAll(has)
const grantEl = document.querySelectorAll(grant)
if (hasPerms) {
Expand Down

0 comments on commit da73051

Please sign in to comment.