Proposal: Allow plugins to set the document title

Alex Plotnick shrike at netaxs.com
Wed Sep 14 13:10:49 PDT 2011


At or around Wed, 14 Sep 2011 12:02:02 PDT, Benjamin Smedberg said:

> > > Why is this inherently better than just using NPRuntime to set
> > > document.title = "string"? This sounds like an unnecessary proposal to me.
> > It appears the proposal page describes why using that is hard.
> The proposal's problem statement doesn't make much sense. There is no 
> escaping required (error and type checking code removed for simplicity):

The problem statement was based on the work-around suggested in bug 117747,
which was to call NPN_GetURL with "javascript:document.title='%s'",
which does require escaping. Your solution does not. I'm working on
my first plugin, and I simply had not investigated the scripting API
(my plugin doesn't need it yet), and so didn't think to look there for
a solution. My mistake.

I still think that the proposal I made is a reasonable one, even if the
case for it is less strong than I believed. The document title seems to
me to be on par with providing the plugin status, for which there's a
whole dedicated function (even if it doesn't work right now in Mozilla).
Your solution, while safe, is still rather heavy-weight: dragging in
a whole DOM API just to provide an extremely common piece of metadata
seems like overkill.

Nevertheless, if no one else cares, I'll withdraw my proposal. In either
case, now that this record exists, perhaps future plugin authors will
be less confused about how to accomplish this seemingly simple goal than
I was.

	-- Alex


More information about the plugin-futures mailing list