Hi there. I'm new to this kind of discussion group and the like, so
sorry if I make any faux pas..es. I ended up talking to some people in
the Chromium IRC channel for a bit during this, and they suggested I
write this up (that was last Thursday, sorry for taking so long to do
so).

I have a decent level of understanding of HTML, and I know a bit of
CSS and Javascript, and I'd love to learn more about them. I also love
Chrome, and have been looking forward to "addons" for Chrome for a
while. Thus, when I saw that the extension feature was out for
developer channel builds of Chrome, and that the creation of
extensions was based in HTML and the like, I decided to try my hand at
some simple extensions.

I read through the documents at 
http://dev.chromium.org/developers/design-documents/extensions
and basically just replicated the extension code there, as well as the
code for the example extensions and played around with them. I was
using Microsoft Wordpad to edit the HTML, and I was using --enable-
extensions --load-extension="c:\myextension" to get an extension
going. But when I tried to do it with two extensions, I ran into some
problems.

I tried editing manifest.json to include something like:
"toolstrips": [
    "my_toolstrip.html"
    "my_other_toolstrip.html"
  ],
Which worked decently except that mousing over the extension inside
Chrome would cause both to have the same description name.
I'm not sure how else to say it, so here's just a pared down IRC log
that should hopefully explain how things went:

16:13   Sidley          I'm just fiddling around with extensions using the
HOWTO in the documentation, and i'm trying to figure out if there's
some way to put two different extensions in the same folder while i
mess aroudn with both of them?
16:14   Sidley                  I tried to combine the manifest.json, and that 
works
mostly fine
16:14   Sidley          by making it refer to two different toolstrips (each for
different extensions i'm trying to make)
16:15   Sidley          but the name value i added while folowing the HOWTO for
one is now going for both toolstrips
16:15   Sidley          meaning i mouse over toolstrip 1 and 2, and both have
the name for toolstrip 1 (the name value in manifest.json)
16:17   evmar           Sidley: i think you need one folder per extension
16:17   evmar           Sidley: the manifest.json defines setting for "the"
extension in the current folder
16:17   Sidley          how can i make chromium grab both folders then?
16:18   Sidley          I tried adding a folder to where the sample extension
folders go
16:18   Sidley          the gmail checker and such
16:18   Sidley          but it deletes that folder whenever i restart chrome
16:18   asargent        Sidley: I don't think the code was designed to support
loading via the command line flag for multiple extensions at once
16:19   Sidley          asargent: that makes sense. How can i get multiple
extensions going then?
16:19   asargent        if you aren't developing both at the same time, you
could run the python script to package one of them into a .crx file,
and then install it
16:20   Sidley          Umm, i'm not well versed in python. Just html, css, and
a bit of javascript. Which is why this extension system caught my
attention (and why i'm fiddling with it).
16:20   Sidley          any other options? or is that it.
16:21   asargent        Sidley: we're working on a web-based system to do the
packaging for you, so that you upload a zip file and it returns a .crx
for you
16:21   Sidley          That's good.
16:22   asargent        Sidley: you don't really need to understand python at
all though to run the script; basically you just point it at the
directory containing your extension, and it creates the .crx file for
you
16:22   asargent        
http://dev.chromium.org/developers/design-documents/extensions/packaging
16:22   Sidley          Yeah, i'm looking at that
16:23   Sidley          i'm just lost on the "chromium_extension.py --indir=path
\to\extension --outfile=myextension.crx" part. I have the
chromium_extension.py file (and a program that can run python
scripts), but how do i get the "chromium_extension.py --indir=path\to
\extension --outfile=myextension.crx" to go? (again, sorry for the
stupid quesitons)
16:24   asargent        Sidley: what platform are you on? windows, mac, linux?
16:24   Sidley          Windows XP
16:24   asargent        and you have python installed?
16:24   Sidley          yes
16:25   asargent        via the installers from python.org, or cygwin?
16:25   Sidley          uhhh
16:25   Sidley          python.org
16:26   Sidley          I'm running "ActiveState ActivePython 2.6" "PythonWin"
16:26   asargent        ok, are you familiar with running programs via command
prompt?
16:26   Sidley          somewhat
16:26   Sidley          i can navigate command prompt, at least
16:27   asargent        basically you need to put the python script somewhere
(say C:\tmp), and then call it pointing at your extension...
16:28   Sidley          ok
16:28   p2mrx           typically you'd run C:\Python25\python.exe something.py 
--
args
16:28   Sidley          ok, i'll try that
16:28   Sidley          (makes sense)
16:38   Sidley          hooray, got some lovely errors and no crx file
16:38   Sidley          on the plus side it turns out PythonWin lets me run the
file quite easily with the arguments without having to use Command
Prompt
16:39   Sidley          on the downside, both PythonWin and Command Prompt are
putting out the same error
16:43   Sidley          ....aaaaand it turns out it was a stupid coding mistake
i made
16:43   Sidley          hooray for me
16:44   evmar           Sidley: it'd be super-helpful if you could write up your
experience with this and post it to chromium-dev
16:44   Sidley          and it worked! hooray!
16:44   evmar           Sidley: even if it was your mistake, maybe we could
improve the error messages
16:44   evmar           Sidley: you're one of the first people to develop an
extension, so your input is really helpful
16:44   Sidley          no, the error message was very simple
16:44   Sidley          It was the python code error messages with it that were
confusing
16:44   evmar           that is good feedback
16:44   Sidley          it put out an error message from you guys on the first
line, then a blob of python errors.
16:45   evmar           (i don't work on extensions, though, which is why i
suggest posting to the list)
16:45   Sidley          I just got lost in the python errors before I realized
the first line told me what was wrong
16:50   Sidley          evmar: where would i post that? in the bug reports?
16:50   evmar           Sidley: in a post to the chromium-dev group
16:50   Sidley          oh, wait, you meant the discussion group at
http://groups.google.com/group/chromium-dev right?
16:50   asargent        Sidley: http://groups.google.com/group/chromium-dev
16:50   evmar           yes
16:50   Sidley          ah ok
16:51   Sidley          might want to add that link to 
http://dev.chromium.org/developers/discussion-groups
16:52   asargent        Sidley: you might also consider creating a bug at
http://crbug.com for the case of wanting to load up multiple
extensions on the command line; that shouldn't be too difficult for us
to implement
16:52   Sidley          Ok, Thanks alot, to all of you


Anyways, hope this is of some sort of help to you girls and
guys...keep up the great work!

--~--~---------~--~----~------------~-------~--~----~
Chromium Discussion mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to