aboutsummaryrefslogtreecommitdiffstats
path: root/tombloo.js
diff options
context:
space:
mode:
Diffstat (limited to 'tombloo.js')
-rw-r--r--tombloo.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/tombloo.js b/tombloo.js
index aee9fd7..59345cb 100644
--- a/tombloo.js
+++ b/tombloo.js
@@ -116,6 +116,16 @@ function getTombloo() {
function getContext() {
const doc = window.content.document;
const win = window.content.wrappedJSObject;
+
+ function getTarget() {
+ if (/^http:\/\/reader\.livedoor\.com/.test(buffer.URL)) {
+ let item = win.get_active_item && win.get_active_item(true);
+ return item ? item.element : doc;
+ } else {
+ return doc;
+ }
+ }
+
return implant(
implant(
{
@@ -123,7 +133,7 @@ function getContext() {
window: win,
title: doc.title.toString() || '',
selection: win.getSelection().toString(),
- target: doc,
+ target: getTarget(),
//event : event,
//mouse : mouse,
//menu : gContextMenu,