Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported jQuery code #9700

Closed
kmario23 opened this issue May 9, 2020 · 3 comments
Closed

Unsupported jQuery code #9700

kmario23 opened this issue May 9, 2020 · 3 comments

Comments

@kmario23
Copy link

kmario23 commented May 9, 2020

Description

I have a small piece of jQuery code that basically does the following:

  • pulls content from a text file that is hosted on a URL
  • after parsing the contents, it generates a random number
  • then it chooses a piece of text based on the generated random index.
  • Finally, it populates a div with the selected content from the step above.

Steps to Reproduce

  1. add jQuery plugin
    <script src="https://code.jquery.com/jquery-3.5.1.min.js" ...> </script>
  2. include jQuery code in a separate .js file with contents, something like:
var ZITAT_FILE_URL = 'http://kmario23.github.io/zitat/zitate.txt';
$.get(ZITAT_FILE_URL, function(data) {
        var zitat_list = data.split('\n');
        var random_id = Math.floor(Math.random() * (zitat_list.length -1));
        $('#zitatdiv').html(zitat_list[random_id]);
        });

Include a div named <div id="zitatdiv"> </div> somewhere in an HTML file.

Actual result:

jquery-unsupported-brave

Expected result:

jquery-chrome-expected

Reproduces how often:

Happens every time. No exceptions to this.

Brave version (brave://version info)

Brave 1.8.95 Chromium: 81.0.4044.138 (Official Build) (64-bit)
Revision 8c6c7ba89cc9453625af54f11fd83179e23450fa-refs/branch-heads/4044@{#999}
OS Linux
JavaScript V8 8.1.307.32

Version/Channel Information:

  • Can you reproduce this issue with the current release?
    yes

  • Can you reproduce this issue with the beta channel?
    Unsure, but I expect the issue to persist there.

  • Can you reproduce this issue with the dev channel?
    Unsure, but I expect the issue to persist there.

  • Can you reproduce this issue with the nightly channel?
    Unsure, but I expect the issue to persist there.

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
    Nope.

  • Does the issue resolve itself when disabling Brave Rewards?
    Nope.

  • Is the issue reproducible on the latest version of Chrome?
    This issue is not present in Chrome / Firefox. Below are the tested versions.

Google Chrome 81.0.4044.129 (Official Build) (64-bit)
Revision 3d71af9f5704a40b85806f4d08925db24605ba25-refs/branch-heads/4044@{#979}
OS Linux
JavaScript V8 8.1.307.31

Firefox: 76.0 (64-bit)

Miscellaneous Information:

Webpage to test and see the issue (in Brave Browser): https://kmario23.github.com/

@pes10k
Copy link
Contributor

pes10k commented May 12, 2020

This isn't a bug. The issue is that you're requesting an insecure resource ("http://kmario23.github.io/zitat/zitate.txt") from a secure/https page. If you change your code to request https://kmario23.github.io/zitat/zitate.txt (note https) instead of http://kmario23.github.io/zitat/zitate.txt (what you have currently) everything will be 👍

@pes10k pes10k closed this as completed May 12, 2020
@kmario23
Copy link
Author

thanks a lot @pes10k! That did the trick. Why aren't we allowed to request contents over networks that send unencrypted contents? Could you please provide some refs to read more on this?

@pes10k
Copy link
Contributor

pes10k commented May 12, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants