aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/context_a.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/assets/js/context_a.js')
-rw-r--r--app/src/main/assets/js/context_a.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/app/src/main/assets/js/context_a.js b/app/src/main/assets/js/context_a.js
index 689c6f0d..6ffa517b 100644
--- a/app/src/main/assets/js/context_a.js
+++ b/app/src/main/assets/js/context_a.js
@@ -32,11 +32,26 @@ if (!window.hasOwnProperty('frost_context_a')) {
var imageUrl = window.getComputedStyle(image, null).backgroundImage.slice(5, -2);
console.log('Context image', imageUrl);
if (typeof Frost !== 'undefined') Frost.loadImage(imageUrl, text);
- } else {
- if (url.includes('photoset_token')) return;
- console.log('Context Content', url, text);
- if (typeof Frost !== 'undefined') Frost.contextMenu(url, text);
+ e.stopPropagation();
+ e.preventDefault();
+ return;
}
+
+ //check if true img exists
+ var img = element.querySelector('img[src*=scontent]')
+ if (img) {
+ var imgUrl = img.src;
+ console.log('Context img', imgUrl);
+ if (typeof Frost !== 'undefined') Frost.loadImage(imgUrl, text);
+ e.stopPropagation();
+ e.preventDefault();
+ return;
+ }
+
+ if (url.includes('photoset_token')) return;
+ console.log('Context Content', url, text);
+ if (typeof Frost !== 'undefined') Frost.contextMenu(url, text);
+
e.stopPropagation();
e.preventDefault();
}