kubuzetto / behind

behind! addon source code repository
https://addons.mozilla.org/en-US/firefox/addon/behind/
Mozilla Public License 2.0
89 stars 3 forks source link

Feature suggestion: Add option to open the direct image URL address instead of "moz-extension" one #27

Open ericpa06 opened 2 years ago

ericpa06 commented 2 years ago

Hi. It's me again, nagging you with some feature that may or not to be useful (thanks for implementing the other feature I suggested). I was wondering if it would be possible to add an option that makes the extension to open the direct URL instead of the "moz-extension" one, like.

Instead of this: moz-extension://8596c4cc-02a1-4f8c-9a51-ebca812f47aa/img.html#!https://pic2.imginn.com/whatever.png

Go directly to the URL and open this: https://pic2.imginn.com/whatever.png

image

Why would this be useful? Well, some people use extensions, such as "Search by Image" that can't access "moz-extension" addresses. So for instance, if you want to open an image to than reverse search that image, it doesn't work, you click in it and that context menu entry doesn't appear, you have to go there, clean the moz-extension part, go to the direct URL. It just seem that it would be more practices if there was an option like this.

johanponken commented 2 years ago

Just FYI, if you press Ctrl-S (Save), the pure URL will load.

Hexerin commented 1 year ago

Adding my support to this being an option. The hotkey workaround that @johanponken brought up does work, but personally I would turn this option on as I would always want results going to the actual image URL.

ericpa06 commented 1 year ago

For anyone wanting to change this behavior, change the bj.js file:

            let u;
            if (bypassMode !== 'off' && oneResult && oneResult.t !== "VIDEO") {
                u = "/img.html#!" + oneResult.e;
            } else {
                u = "/inline.html";
            }

Remove the following part: "/img.html#!" + . So the code will be:

            let u;
            if (bypassMode !== 'off' && oneResult && oneResult.t !== "VIDEO") {
                u =  oneResult.e;
            } else {
                u = "/inline.html";
            }