12
  • Basic usage of the Image search UI results in `Uncaught DOMException: The operation is insecure.` Under Firefox

  • BugsDesktopAppearanceDone

Under Firefox, clicks on results to expand the image result in:

Too many calls to Location or History APIs within a short timeframe. k_ima.min.js:1:19232
Uncaught DOMException: The operation is insecure.
    onclick https://kagi.com/asset/v2/js/k_ima.min.js?v=f7409af16a06a7643ac6b103e8271bf557f6b553:1
    initImagePreview https://kagi.com/asset/v2/js/k_ima.min.js?v=f7409af16a06a7643ac6b103e8271bf557f6b553:1
    renderImagesPage https://kagi.com/asset/v2/js/k_ima.min.js?v=f7409af16a06a7643ac6b103e8271bf557f6b553:1
    <anonymous> https://kagi.com/asset/v2/js/k_ima.min.js?v=f7409af16a06a7643ac6b103e8271bf557f6b553:1
    scriptStreamDispatchEvent https://kagi.com/images?q=flush baseboard:1
    scriptStreamCallback https://kagi.com/images?q=flush baseboard:1
    <anonymous> https://kagi.com/images?q=flush baseboard:1015
k_ima.min.js:1

Or:

Uncaught (in promise) DOMException: Invalid encoded image data.

For roughly 80% of result images.

Basic usage of the image search (clicking on images to expand them) to work.

    I'm seeing this as well all over the site. For example: I'll initiate a search in my browser which will take me to the results page. Then, if it update my query in the search box on the results page and hit enter, 90% of the time it just ignores my query and gives this error.

    This makes the image search results page completely unusable for me and makes the search results page extremely frustrating to use.

    Firefox version information:

    Version 	134.0
    Build ID 	20241230151726
    Distribution ID 	mozilla-deb
    Update Channel 	release
    User Agent 	Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0
    OS 	Linux 6.11.10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.10-1 (2024-11-23)
      • Edited

      Hi there - We cannot seem to reproduce this issue.

      I personally am also using firefox 134.0, and haven't had any issues like this.
      I CAN reproduce the "Invalid encoded image data.", that's a separate thing which should not affect functionality.

      but the insecure operation, I am not sure.

      @EMAILBEN145 @LoganKaser
      Are either of you using extensions & if so, have you tried disabling them?
      Is this issue only present in firefox, or does it persist into other browsers?
      I assume that you have cookies enabled and all that stuff?

      We'll continue to investigate to see if we can reproduce it. If anyone else has this issue, any info you can give is very helpful!

        I'm on Firefox developer edition 135.0b5 (aarch64).
        I don't have any unusual configuration options set, tracking protection is left at the default settings.
        This is on my work laptop, so it's pretty close to default. I tried disabling uBlock Origin, but it did not make any difference.

        I can confirm image results work as expected with Safari and Chrome

        Whenever I search for something, and then add or change anything to the search in the input, clicking enter or the search icon does nothing. I have to do a refresh of the page and then re-add the text and most of the time it works, but some times I have to close the tab, and try again.

        Whenever I search for images and try to click on the image results nothing happens, the URL doesn't show up in the status field of the browser either, I click a few times around on different images, and sometimes I shows the image other times it actually goes back to the previous page.

        I'm using Firefox 134.0.1 (64-bit) on Windows 11 Pro. This has only happened in Firefox currently. Tried it on Edge and Vivaldi, and they seem to work correctly.

        Also, this doesn't always happen, but sporadic. I don't know how to explain it, but searched seem "slugish".

        Might not be Kagi seeing as it work everywhere else, just curious if anyone else have noticed something like it? I have no add-ons that interfere with Kagi, or I've turned of them interfering with Kagi.

        None of the above. 😛

          Hmm, I can't replicate and I'm on the exact same setup (Firefox 134.0.1 Win 11 Pro)

            I have started seeing the same issue, at least for the last couple of weeks. I have not tried any browser other than firefox on MacOS or Linux (at least >134.0.0). A family member on windows firefox reports the same issue.

            I will search for something and quickly see that I need to add an extra term or remove something, I will do that and press enter and nothing happens, Ill click the search bar and or the search button and nothing happens either. Usually I click in empty space around the page and re-click the search text field and then it works.

            I have attached a video of the issue.

            I have the same problem.

            User agent: Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0
            Using Firefox on Arch Linux, installed from the normal Arch repos.

            I think this is caused by Uncaught DOMException: The operation is insecure. which can be seen in the console.

            When searching fails, I see this:

            Too many calls to Location or History APIs within a short timeframe. search:293:24380
            Uncaught DOMException: The operation is insecure.
                onsubmit https://kagi.com/search?q=testing two:293
                EventHandlerNonNull* https://kagi.com/search?q=testing two:293
                EventListener.handleEvent* https://kagi.com/search?q=testing two:293
            search:293

            When I click on an image in the image search results and it does not load, I see this:

            Uncaught DOMException: The operation is insecure.
                onclick https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                initImagePreview https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                renderImagesPage https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                <anonymous> https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                onSocketMessage https://kagi.com/images?q=testing:356
                onSocketMessage https://kagi.com/images?q=testing:356
                connect https://kagi.com/images?q=testing:356
                onsubmit https://kagi.com/images?q=testing:356
                EventHandlerNonNull* https://kagi.com/images?q=testing:356
                EventListener.handleEvent* https://kagi.com/images?q=testing:356
            k_ima.min.js:1
                onclick https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                (Async: EventHandlerNonNull)
                initImagePreview https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                renderImagesPage https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                <anonymous> https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                onSocketMessage https://kagi.com/images?q=testing:356
                forEach self-hosted:157
                onSocketMessage https://kagi.com/images?q=testing:356
                (Async: EventHandlerNonNull)
                connect https://kagi.com/images?q=testing:356
                onsubmit https://kagi.com/images?q=testing:356
                (Async: EventHandlerNonNull)
                <anonymous> https://kagi.com/images?q=testing:356
                (Async: EventListener.handleEvent)
                <anonymous> https://kagi.com/images?q=testing:356

            Happy to help diagnose, let me know if you need any further information or testing.

              • Edited

              Phew, I'm not the only one!

              Did words always have a space in the URL field, I'm just used to search engines using + instead of spaces.

              Edit: If you search with several words, it shows in the URL field with + instead of spaced for a split second.

              Edit #2: This is Firefox behavior... Edge shows it like it normally is:

              Edit #3: Firefox removes the + in Google searches too. So probably not related. :/

                • Edited

                bcampbell

                Got the same. Images loaded, clicking them made the errors, and then clicking did nothing before going back to the previous page.

                Uncaught DOMException: The operation is insecure.
                    onclick https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                    initImagePreview https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                    renderImagesPage https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                    <anonymous> https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                    onSocketMessage https://kagi.com/images?q=testing:356
                    onSocketMessage https://kagi.com/images?q=testing:356
                    connect https://kagi.com/images?q=testing:356
                    onsubmit https://kagi.com/images?q=testing:356
                    EventHandlerNonNull* https://kagi.com/images?q=testing:356
                    EventListener.handleEvent* https://kagi.com/images?q=testing:356
                k_ima.min.js:1
                    onclick https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                    (Async: EventHandlerNonNull)
                    initImagePreview https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                    renderImagesPage https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                    <anonymous> https://kagi.com/asset/v1/js/k_ima.min.js?v=c8dda5c831e57e322ba05aa121fa11d497dd2a9d:1
                    onSocketMessage https://kagi.com/images?q=testing:356
                    forEach self-hosted:157
                    onSocketMessage https://kagi.com/images?q=testing:356
                    (Async: EventHandlerNonNull)
                    connect https://kagi.com/images?q=testing:356
                    onsubmit https://kagi.com/images?q=testing:356
                    (Async: EventHandlerNonNull)
                    <anonymous> https://kagi.com/images?q=testing:356
                    (Async: EventListener.handleEvent)
                    <anonymous> https://kagi.com/images?q=testing:356
                
                ​

                  Same issue here with Firefox, very annoying, upvoted as I feel this is a major usability issue.

                  Merged 7 posts from Search has been weird for over a week.
                    • Edited

                    Hey all, just merging this in with the other post regarding this.

                    nat posted something that could potentially help, but we should not be navigating this much in the first place.
                    The history calls exceeded errors feel very weird but it's also something I cannot reproduce even when spamming images/queries.

                    It seems to be firefox specific, across multiple operating systems - all seemingly on 134.0 and up.

                    We are still looking into the issue and will keep you updated - thanks.

                    Changing dom.navigation.navigationRateLimit.count from the default of 200
                    to 0 (limit disabled) does “fix” this for me, I suggest you check your about:config, it's possible this
                    default is not being migrated to older installs, or something like that.
                    This does suggest that something Kagi is doing is calling the history / location API a lot more than it should

                      https://github.com/ClearURLs/Addon/issues/412
                      https://github.com/ClearURLs/Addon/issues/409
                      I think this may be related to these issues.
                      In particular, this “feature”:

                      Seems to be necessary to trigger the issue (it's on by default). Following those issue threads, it looks like that change may be reverted soon, which would unbreak kagi.
                      At the very least, I'm now pretty sure that the issue was extension related, at least for me.
                      FWIW it's a popular extension, probably that alone is enough to explain the incident rate.

                        LoganKaser

                        I can confirm that I use the ClearURLs extension and that disabling that 'Prevent tracking injection over history API' feature does indeed resolve the issue, thanks so much for that great detective work! Looks like an upstream bug with that extension as it's breaking a number of websites, including Google, Bing, DuckDuckGo and GitHub as well as Kagi. Probably would be acceptable to let Kagi users know that they should turn that feature off until a bug fix is available from the extension vendor.