jQuery: The Write Less, Do More JavaScript Library

Ticket #946 (closed enhancement: wontfix)

Opened 1 year ago

Last modified 2 months ago

Occurrence of // in strings in jquery.js causes problems with idiotic JS-filters

Reported by: warp@… Assigned to: anonymous
Type: enhancement Priority: major
Milestone: 1.2.4 Component: core
Version: Keywords:
Cc: Needs: Review

Description (last modified by flesler) (diff)

Some German cell-phone internet providers obviously employ absolutely stupid transparent proxies which filter .js Files to decrease the download size and seem to cut off everything in JS sources after //. jQuery's XPath Code contains the following line:

if ( !t.indexOf("//") ) {

I wonder if this could maybe be rewritten to something like

if( !t.indexOf("/"+"/")) {

or maybe

if( !t.indexOf("//")) {

(I know, this is strictly speaking not a problem in jQuery itself, but it would be an easy work-around to not trigger such a filter. We already told the affected users to contact the cell phone provider, but it's not clear whether this will help)

Attachments

Change History

Changed 1 year ago by warp

The problem is worse than originally thought. Not only E-Plus filters Javascript this way, also Vodafone Germany does it.

Also, at least one other part of jQuery which is affected is the IE script defer hack:

document.write("<scr" + "ipt id=ie_init defer=true " +

"src=//:></script>");

Changing src=//: to src=// seems to work around the problems.

This should _really_ be fixed in the standard distribution, especially as it's an easy to use fix which will avoid problems for many people.

Changed 6 months ago by Eli-D

Worthy to note, the defer hack is no longer used in bindReady().

The only instance of "//" I found is in ajax():

// If we're requesting a remote document
// and trying to load JSON or Script with a GET
if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && ( s.dataType == "script" || s.dataType =="json" ) && s.type.toLowerCase() == "get" ) {

Changed 2 months ago by flesler

  • need set to Review
  • status changed from new to closed
  • resolution set to wontfix
  • description changed from Some German cell-phone internet providers obviously employ absolutely stupid transparent proxies which filter .js Files to decrease the download size and seem to cut off everything in JS sources after //. jQuery's XPath Code contains the following line: if ( !t.indexOf("//") ) { I wonder if this could maybe be rewritten to something like if( !t.indexOf("/"+"/")) { or maybe if( !t.indexOf("//")) { (I know, this is strictly speaking not a problem in jQuery itself, but it would be an easy work-around to not trigger such a filter. We already told the affected users to contact the cell phone provider, but it's not clear whether this will help) to Some German cell-phone internet providers obviously employ absolutely stupid transparent proxies which filter .js Files to decrease the download size and seem to cut off everything in JS sources after //. jQuery's XPath Code contains the following line: if ( !t.indexOf("//") ) { I wonder if this could maybe be rewritten to something like if( !t.indexOf("/"+"/")) { or maybe if( !t.indexOf("//")) { (I know, this is strictly speaking not a problem in jQuery itself, but it would be an easy work-around to not trigger such a filter. We already told the affected users to contact the cell phone provider, but it's not clear whether this will help)
  • milestone set to 1.2.4

The ajax case is now gone, a regex is used which has a: '...\/\/...'. As for the XPath, it's no longer supported.

This seems to be accidentally fixed. Please reopen if you another occurrence of // and we'll see how to deal with it.

Note: See TracTickets for help on using tickets.