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

Code browser and PR diff replace URLs they shouldn't #2482

Closed
Vannevelj opened this issue Oct 8, 2019 · 2 comments
Closed

Code browser and PR diff replace URLs they shouldn't #2482

Vannevelj opened this issue Oct 8, 2019 · 2 comments
Labels

Comments

@Vannevelj
Copy link

When viewing a PR as well as browsing to the code directly, I'm seeing URLs in the code being replaced by Refined Github.
When I do a search for the content that is different, I can see in the search result preview the real content. When I then click on the search result to open the exact file, it shows me the wrong content.

I have verified this is caused by Refined Github as enabling/disabling it makes it work/break.
When refreshing the page I can see for a fraction of a second that the first load contained a different diff than what I end up with so I'm certain something is replacing it.

Through trial-and-error I have found that the offending feature is linkify-code. This seems relevant because the code that I am looking at is a dictionary where the keys are URLs:

{ VastTagKeys.VideoEmbeddablePlayer, "http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/xxx/Video_EmbeddablePlayer&ciu_szs&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]" },

With the feature enabled, this becomes

{ VastTagKeys.VideoEmbeddablePlayer, "[referrer_url]&correlator=[timestamp]" },

Notice how the url ends with &url=[referrer_url]&correlator=[timestamp] -- it feels as if the parsing is going wrong somewhere.

I've disabled the feature for the time being so I'm unblocked on this.

@Vannevelj Vannevelj added the bug label Oct 8, 2019
@fregante
Copy link
Member

fregante commented Nov 8, 2019

That's what you get by using both doubleclick and an ad blocker. 😁

linkify-urls works correctly but then the ad blocker hides the link.

Works as expected, you'll have to disable your ad blocker.

Reduced demo pastable on: https://npm.runkit.com/linkify-urls (as long as you first disable the ad blocker or linkify-code here)

const linkifyUrls = require("linkify-urls")

linkifyUrls('http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/xxx/Video_EmbeddablePlayer&ciu_szs&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]')

@fregante fregante closed this as completed Nov 8, 2019
@Vannevelj
Copy link
Author

Hah. Good find, that makes sense. Thanks for looking into this.

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

No branches or pull requests

2 participants