No access to document from a plugin

RESOLVED FIXED in M13

Status

()

Core
Plug-ins
P3
enhancement
RESOLVED FIXED
19 years ago
19 years ago

People

(Reporter: av (gone), Assigned: av (gone))

Tracking

Trunk
All
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

19 years ago
Current plugin API does not allow to access document.
(Assignee)

Comment 1

19 years ago
Proposed fix is to add a method to nsIPluginTagInfo as follows:

nsIPluginTagInfo.h

   NS_IMETHOD GetDOMElement(nsIDOMElement* *result) = 0;
==================
nsPluginInstancePeer.h

class nsPluginInstancePeerImpl
...
   NS_IMETHOD GetDOMElement(nsIDOMElement* *result);
==================
nsPluginInstancePeer.cpp

NS_IMETHODIMP nsPluginInstancePeerImpl::GetDOMElement(nsIDOMElement* *result)
{
  if (nsnull != mOwner)
  {
    nsIPluginTagInfo  *tinfo;
    nsresult          rv;

    rv = mOwner->QueryInterface(kIPluginTagInfoIID, (void **)&tinfo);

    if (NS_OK == rv)
    {
      rv = tinfo->GetDOMElement(result);
      NS_RELEASE(tinfo);
    }

    return rv;
  }
  else
  {
    *result = nsnull;
    return NS_ERROR_FAILURE;
  }
}
==================
nsObjectFrame.cpp

class nsPluginInstanceOwner
...
  NS_IMETHOD GetDOMElement(nsIDOMElement* *result);
...
NS_IMETHODIMP nsPluginInstanceOwner::GetDOMElement(nsIDOMElement* *result)
{
  nsresult rv = NS_ERROR_FAILURE;

  *result = nsnull;

  if (nsnull != mOwner)
  {
    nsIContent  *cont;

    mOwner->GetContent(&cont);

    if (nsnull != cont)
    {
      rv = cont->QueryInterface(nsIDOMElement::GetIID(), (void **)result);
      NS_RELEASE(cont);
    }
  }
  return rv;
}
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 2

19 years ago
Checked in.

Comment 3

19 years ago
Andrei, please mark this bug as VERIFIED.
QA Contact: shrir → av
You need to log in before you can comment on or make changes to this bug.