-
Notifications
You must be signed in to change notification settings - Fork 65
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
www.grupodelrey.com.br - Very slow page load #125671
Comments
Thank you for reporting this issue, I was able to reproduce it. The page loads really slow compared to Chrome. Tested on: Notes:
Moving to Needsdiagnosis. [qa_32/2023] |
@sv-calin wonder if you could record a perf profile, please? |
Performance profile: https://share.firefox.dev/47BV7Ed Note: Captured with Standard ETP Tested on: [inv_33/2023] |
The site is attempting to parse css and apply some modifications to it and it ends up in an endless loop: //read style tags
$("style").each(function(){
var conts=$(this).html();
readCss(conts,"background",false);
});
//@param: path - path which to make the urls change to (false to disable)
function readCss(conts,prop,path){
var output={};
//get rid of comments
conts=conts.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g,'');
var pos=conts.indexOf(prop);
//loop through all backgrounds in the stylesheet
while(pos>-1){
var bgVal=replaceWithLower($.trim(conts.substr(conts.indexOf(":",pos+1)+1,conts.indexOf(";",pos+1)-conts.indexOf(":",pos+1)-1)),"url(");
//only do anything if there are actually multiple bgs in the property
bgVal=replaceInnerComma(bgVal);
if(bgVal.indexOf(",")>-1){
//make paths relative to the stylesheet work out
if(path){
var urlPos=bgVal.indexOf("url(");
while(urlPos>-1){
//don't do any working on absolute urls
if(bgVal.substr(urlPos+4,7).toLowerCase()!="http://"){
var extraSlash=(bgVal.substr(urlPos+4,1) == '/');
var domain=document.URL.substr(0,document.URL.indexOf('/',9));
bgVal=bgVal.substr(0,urlPos+4)+(extraSlash ? domain :path)+bgVal.substr(urlPos+4);
};
//seek to next
urlPos=bgVal.indexOf("url(",urlPos+1);
};
};
//determine if there was an important in this bg value
var important=bgVal.length;
bgVal=bgVal.replace("!important","");
important=(important==bgVal.length ? false : true);
var prevBrace=conts.lastIndexOf("}",pos)+1;
//Allow for charset
if(conts.lastIndexOf(";",pos)+1>prevBrace) prevBrace=conts.lastIndexOf(";",conts.lastIndexOf("{",pos))+1;
if(prevBrace==-1) prevBrace=0;
var selector = $.trim(conts.substr(prevBrace,conts.lastIndexOf("{",pos)-prevBrace));
//account for multiple selectors
var selSplit=selector.split(",");
for(var i=0;i<selSplit.length;i++){
var curSel=$.trim(selSplit[i]);
curSel=replaceWithLower(curSel,":active");
curSel=replaceWithLower(curSel,":hover");
curSel=replaceWithLower(curSel,":focus");
output[curSel]={property:prop,value:bgVal,selScore:selectorScore(curSel,important)};
};
};
pos=conts.indexOf(prop,conts.indexOf(";",pos+1));
};
//put the contents into the storage
$.extend(myCss,output);
};
//find lower/uppercase combinations and replace with lowercase for compatability
function replaceWithLower(inStr,replaceWith){
var linStr=inStr.toLowerCase();
var pos=linStr.indexOf(replaceWith);
while(pos>-1){
inStr=inStr.substr(0,pos)+replaceWith+inStr.substr(pos+replaceWith.length);
pos=linStr.indexOf(replaceWith,pos+1);
};
return inStr;
};
It only happens in Firefox because of the incorrect UA detection : //conditional for which browsers you want to support (ie6/7/8,firefox<=3.5)
if(($.browser.msie && parseFloat($.browser.version)>=6 && parseFloat($.browser.version)< 9)||
($.browser.mozilla && parseInt($.browser.version.substr(0,1))<=1 && parseInt($.browser.version.substr(2,1))<=9 && parseInt($.browser.version.substr(4,1))<=1)){ Capping the rv part of UA to 99 |
thanks for the profile! |
URL: https://www.grupodelrey.com.br/linhas
Browser / Version: Firefox Mobile 116.0
Operating System: Android 13
Tested Another Browser: Yes Chrome
Problem type: Site is not usable
Description: Page not loading correctly
Steps to Reproduce:
It's Slowly to open. +60sec.
Sometimes don't open.
Site riquires "cookies".
Totally instable.
View the screenshot
Browser Configuration
View console log messages
From webcompat.com with ❤️
The text was updated successfully, but these errors were encountered: