Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

nsIDroppedLinkHandler

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

Please add a summary to this article.
1.0
51
Introduced
Gecko 2.0
Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Method overview

boolean canDropLink(in nsIDOMDragEvent aEvent, in PRBool aAllowSameDocument);
AString dropLink(in nsIDOMDragEvent aEvent, out AString aName, [optional] in boolean aDisallowInherit);
void dropLinks(in nsIDOMDragEvent aEvent, [optional] in boolean aDisallowInherit, [optional] out unsigned long aCount, [retval, array, size_is(aCount)] out nsIDroppedLinkItem aLinks);

Methods

canDropLink()

Determines if a link being dragged can be dropped.

boolean canDropLink(
  in nsIDOMDragEvent aEvent,
  in PRBool aAllowSameDocument
);
Parameters
aEvent
A dragenter or dragover event.
aAllowSameDocument
If false, drops are only allowed if the document of the source of the drag is different from the destination. This check includes any parent, sibling and child frames in the same content tree. If true, the source is not checked.
Return value

true if the link being dragged can be dropped.

Exceptions thrown
Missing Exception
Missing Description

dropLink()

Given a drop event, determines the link being dragged. If a uri is returned the caller can, for instance, load it. If null is returned, there is no valid link to be dropped.

AString dropLink(
  in nsIDOMDragEvent aEvent,
  out AString aName,
  [optional] in boolean aDisallowInherit
);
Parameters
aEvent
A drop event.
aName
The link title if it exists, or an empty string otherwise.
Return value

A uri, or null if there is no valid link to be dropped.

Exceptions thrown
NS_ERROR_DOM_SECURITY_ERR
Error will be thrown and the event canceled if the receiving target should not load the uri for security reasons. This will occur if the source of the drag initiated a link for dragging that it itself cannot access. This prevents a source document from tricking the user into a dragging a chrome url for example.

dropLinks()

Given a drop event, determines the link being dragged. If non-empty links array is returned the caller can, for instance, load it. If empty links array is returned, there is no valid link to be dropped.

void dropLinks(
  in nsIDOMDragEvent aEvent,
  [optional] in boolean aDisallowInherit,
  [optional] out unsigned long aCount,
  [retval, array, size_is(aCount)] out nsIDroppedLinkItem aLinks
);
Parameters
aEvent
A drop event.
aDisallowInherit
 
aCount
Receives the count of aLinks array
aLinks
Recives an array of objects with nsIDroppedLinkItem interface
Return value

Nothing.

See also

ドキュメントのタグと貢献者

 このページの貢献者: arai, Sheppy, trevorh
 最終更新者: arai,