Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Chrome extensions are generally made with HTML/CSS/JS so ClojureScript should work just fine because it compiles to JavaScript. That being said, I don't think anyone has actually built a large extension with ClojureScript yet. As a proof of concept here's a general outline of how to make a simple alert extension that will say Zaboomafoo (sorry for that name):</p> <p>Install <a href="https://github.com/technomancy/leiningen" rel="noreferrer">Leiningen</a> and <a href="https://github.com/emezeske/lein-cljsbuild" rel="noreferrer">lein-cljsbuild</a> first. Read the docs for lein-cljsbuild and check out the <a href="https://github.com/clojure/clojurescript/wiki" rel="noreferrer">wiki on ClojureScript</a> to understand how to use lein-cljsbuild for projects and compiling. </p> <p>Make a ClojureScript file that displays an alert saying "Zaboomafoo" like this: </p> <pre><code>(ns Zaboomafoo.hello) (js/alert "Zaboomafoo") </code></pre> <p>Compile this with <code>lein cljsbuild</code> to get a JavaScript file. Then add a basic HTML file and manifest.json for the extension. </p> <p>Zaboomafoo.html:</p> <pre><code>&lt;!Doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Zaboomafoo!&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;script type="text/javascript" src="Zaboomafoo.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>manifest.json:</p> <pre><code>{ "name": "Displays Zaboomafoo when opening a new tab", "version": "0.1", "incognito": "split", "chrome_url_overrides": { "newtab": "Zaboomafoo.html" }, "manifest_version": 2 } </code></pre> <p>Put the new manifest.json, Zaboomafoo.html, and Zaboomafoo.js into a folder somewhere obvious. Finally, go to the chrome extension page, turn on developer mode, load unpacked extension, and open a new tab. The extension should load an alert that annoyingly says "Zaboomafoo" when you open the tab. Hopefully making browser extensions gets to be a little more popular but this is the general flow of it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload