Maybe try to execute something like that -
inject.js -
var GMonkey;
if (gmonkey)
{
 gmonkey.init("undefined",function (api) { GMonkey = api });
// Find out the ID of the object you
// want using GMonkey, reference here -
// http://code.google.com/p/gmail-greasemonkey/wiki/GmailGreasemonkey10API
// element = gmail.getNavPaneElement();
//
// Find the actual ID or class name, or whatever
// identifier that can help you later track it down
// again, using this example -
//
// elementIdentifier = element.id;
// elementIdentifierType = "ID";
// Or
// elementIdentifier = element.className;
// elementIdentifierType = "className";
// Or however you choose.
 hiddenSpan = document.createElement("HIDDENSPAN");
 hiddenSpan.id = "hidden-span";
 hiddenSpan.style.display = "none";
 hiddenSpan.innerText = elementIdentifier;
 hiddenSpan.setAttribute("type",elementIdentifierType);
 document.body.appendChild(hiddenSpan);
}

Then in the content script JavaScript file -
script = document.createElement("script");
script.src = chrome.extensions.getUrl("inject.js");
script.onload = doStuff;
document.body.appendChild(script);
var requestedElement
function doStuff()
{
 element = document.getElementById("hidden-span")
 if (element.getAttribute("type") == "ID")
  requestedElement = document.getElementById(element.innerText);
 else
  requestedElement = document.getElementsByClassName(element.innerText);
}


Does it work?

☆PhistucK


On Mon, Dec 21, 2009 at 03:32, FractalBob <ruom...@gmail.com> wrote:

> Hi,
>
> I want to extend Gmail and that includes creating a button in a
> specific position on the page. I know, visually, where I want it to
> go, but I'm having trouble translating the UI element to the stuff the
> DOM inspector/Developer tool displays. Any guidance would be very much
> appreciated.
>
> Bob
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Chromium-extensions" group.
> To post to this group, send email to chromium-extensi...@googlegroups.com.
> To unsubscribe from this group, send email to
> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/chromium-extensions?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to 
chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to