michael@0: #ifdef 0 michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #endif michael@0: michael@0: let gDragDataHelper = { michael@0: get mimeType() { michael@0: return "text/x-moz-url"; michael@0: }, michael@0: michael@0: getLinkFromDragEvent: function DragDataHelper_getLinkFromDragEvent(aEvent) { michael@0: let dt = aEvent.dataTransfer; michael@0: if (!dt || !dt.types.contains(this.mimeType)) { michael@0: return null; michael@0: } michael@0: michael@0: let data = dt.getData(this.mimeType) || ""; michael@0: let [url, title] = data.split(/[\r\n]+/); michael@0: return {url: url, title: title}; michael@0: } michael@0: };