diff --git a/.gitignore b/.gitignore index 3270146..8883822 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,4 @@ bundle-json.js bundle-markdown.js bundle-ssb.js bundle-reader.js +bundle-orgmode.js diff --git a/background.js b/background.js index 0253dfb..cbb09ab 100644 --- a/background.js +++ b/background.js @@ -1,6 +1,7 @@ /* global chrome */ const FORBIDDEN_PROTOCOLS = ['devtools:'] +// TODO: This hook is not triggered for org files, they're just simply downloaded. chrome.webNavigation.onDOMContentLoaded.addListener(handleLoaded) /** @@ -15,14 +16,17 @@ const TYPE_MAP = { // TODO: Hooks for activitystream rendering? 'application/activity+json': 'json', 'application/ld+json': 'json', - 'application/ssb+json': 'ssb' + 'application/ssb+json': 'ssb', + 'text/x-org': 'orgmode', + 'application/vnd.lotus-organizer': 'orgmode' // automatic chrome-headers } const SCRIPT_MAP = { markdown: scriptURL('markdown'), gemini: scriptURL('gemini'), json: scriptURL('json'), - ssb: scriptURL('ssb') + ssb: scriptURL('ssb'), + orgmode: scriptURL('orgmode') } const code = ` diff --git a/manifest.json b/manifest.json index 1041816..da4bfff 100644 --- a/manifest.json +++ b/manifest.json @@ -28,6 +28,7 @@ "bundle-markdown.js", "bundle-json.js", "bundle-ssb.js", - "bundle-reader.js" + "bundle-reader.js", + "bundle-orgmode.js" ] } diff --git a/package.json b/package.json index 57323c5..fa02abe 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "build-gemini": "browserify ./gemini.js > bundle-gemini.js", "build-ssb": "browserify ./ssb.js > bundle-ssb.js", "build-reader": "browserify ./reader.js > bundle-reader.js", - "build": "npm run build-markdown && npm run build-json && npm run build-gemini && npm run build-ssb && npm run build-reader" + "build-org": "esbuild --bundle orgmode.js --outfile=bundle-orgmode.js", + "build": "npm run build-markdown && npm run build-json && npm run build-gemini && npm run build-ssb && npm run build-reader && npm run build-org" }, "repository": { "type": "git", @@ -25,6 +26,7 @@ "homepage": "https://github.com/RangerMauve/extension-agregore-renderer#readme", "devDependencies": { "browserify": "^17.0.0", + "esbuild": "^0.23.0", "standard": "^17.0.0" }, "dependencies": { @@ -36,7 +38,8 @@ "ssb-fetch": "^1.5.2", "ssb-markdown": "^6.0.7", "ssb-ref": "^2.16.0", - "ssb-uri2": "^1.8.1" + "ssb-uri2": "^1.8.1", + "uniorg": "^1.2.0" }, "standard": { "ignore": [