Page 3 of 3

Re: FireFox link error

Posted: 19 Mar 2013, 10:01
by Hamza
That is not related to User Agent but to javascript. It seems that Internet Explorer has something (added/removed/modified) in it's javascript that all other borwsers haven't and this website is basing their JS code on this. Either you play on this website using the cheat "clid=1" and you can play on Firefox/Chrome browsers, or you will have to play only with Internet Explorer.

Thanks Microsoft :P

Re: FireFox link error

Posted: 19 Mar 2013, 18:56
by Ed_P
I don't agree. Numbers other than 1 work. 20, 10, 30, 8.

The userAgent gets me by the small javascript code for FireFox but there must be something else that needs checked. I need to add some alerts to the IE code I downloaded and see what's going on. Especially want to see what file it's looking for.

I don't see any tests for IE but there may be other ways to check for it other than userAgent.

Re: FireFox link error

Posted: 19 Mar 2013, 20:36
by Hamza
The error comes from a 3rd party script named 'pffdata.js' which load game data. In the javascript code, if that file which load an array named 'pffdata' is undefined or empty, it can't works. I think preloading data would be the solution but how?

Re: FireFox link error

Posted: 20 Mar 2013, 03:56
by Ed_P
If pffdata.js can load a file with a clid of 1-31 why can't it do 0? It's a very simple script.

Code: Select all

pffdata = new Array();
pffdata[0]= new Array("pff130315.xml","03/15/13");
pffdata[1]= new Array("pff130314.xml","03/14/13");
pffdata[2]= new Array("pff130313.xml","03/13/13");
pffdata[3]= new Array("pff130312.xml","03/12/13");
pffdata[4]= new Array("pff130311.xml","03/11/13");
pffdata[5]= new Array("pff130310.xml","03/10/13");
pffdata[6]= new Array("pff130309.xml","03/09/13");
pffdata[7]= new Array("pff130308.xml","03/08/13");
pffdata[8]= new Array("pff130307.xml","03/07/13");
pffdata[9]= new Array("pff130306.xml","03/06/13");
pffdata[10]= new Array("pff130305.xml","03/05/13");
pffdata[11]= new Array("pff130304.xml","03/04/13");
pffdata[12]= new Array("pff130303.xml","03/03/13");
pffdata[13]= new Array("pff130302.xml","03/02/13");
pffdata[14]= new Array("pff130301.xml","03/01/13");
pffdata[15]= new Array("pff130228.xml","02/28/13");
pffdata[16]= new Array("pff130227.xml","02/27/13");
pffdata[17]= new Array("pff130226.xml","02/26/13");
pffdata[18]= new Array("pff130225.xml","02/25/13");
pffdata[19]= new Array("pff130224.xml","02/24/13");
pffdata[20]= new Array("pff130223.xml","02/23/13");
pffdata[21]= new Array("pff130222.xml","02/22/13");
pffdata[22]= new Array("pff130221.xml","02/21/13");
pffdata[23]= new Array("pff130220.xml","02/20/13");
pffdata[24]= new Array("pff130219.xml","02/19/13");
pffdata[25]= new Array("pff130218.xml","02/18/13");
pffdata[26]= new Array("pff130217.xml","02/17/13");
pffdata[27]= new Array("pff130216.xml","02/16/13");
pffdata[28]= new Array("pff130215.xml","02/15/13");
pffdata[29]= new Array("pff130214.xml","02/14/13");
Something is missing. What makes 0 unique?

Re: FireFox link error

Posted: 20 Mar 2013, 11:12
by Hamza
Please understand that javascript is different between browsers. Maybe '0' is understood as 'empty' which may be interpreted as 'undefined'. Using clid=1 cheat is the only solution I can see so far. Sorry

Re: FireFox link error

Posted: 20 Mar 2013, 14:56
by Ed_P
No need to apologize, it's not your fault. I'd just like to see what argument is actually being passed to the pffdata.js script if no clid is given, or it's set to 0.

hmmmm if clids greater than 0 equal to pffdata entries 0-31 then a clid of 0 equates to the top line of code, pffdata = new Array(); which will indeed return a bad file name.

If clid=1 does IE return the same file as FF?

Missing something.

Re: FireFox link error

Posted: 20 Mar 2013, 17:34
by Hamza

Code: Select all

var todayDay = "";
function todayDate() {
var result="";
if ((clid==0)||(typeof(pffdata) == "undefined")){
var now=new Date();
var y=now.getYear()+"";
var yy=y.substring(2,4);
if (navigator.userAgent.indexOf("Firefox")!=-1){
yy = LZ(yy);
}
Here is the code when I told you there is a different interpretation between browsers and where clid is checked for Firefox compatible browser.

Re: FireFox link error

Posted: 20 Mar 2013, 17:44
by Ed_P
Yes, and I downloaded and installed the userAgent switcher for FireFox and set it to IE and the URL still failed. There has to be something more/something else.

Re: FireFox link error

Posted: 20 Mar 2013, 18:14
by Hamza
No, as previously said. The check is done on a part you can't control which is JavaScript core.

Re: FireFox link error

Posted: 23 Mar 2013, 19:36
by Ed_P
So we start with:

Code: Select all

var todayDay = "";
function todayDate() {
var result="";
if ((clid==0)||(typeof(pffdata) == "undefined")){
var now=new Date();
var y=now.getYear()+"";
var yy=y.substring(2,4);
alert (yy)
if (navigator.userAgent.indexOf("Firefox")!=-1){
yy = LZ(yy);
}
alert (yy)
And see:

IE:
13
13

FF:
3
03

So the answer is:

Code: Select all

var todayDay = "";
function todayDate() {
var result="";
if ((clid==0)||(typeof(pffdata) == "undefined")){
var now=new Date();
var y=now.getYear()+"";
var yy=y.substring(2,4);
alert (yy)
if (navigator.userAgent.indexOf("Firefox")!=-1){
yy = 1+yy;
}
alert (yy)
This works in FF, haven't tried IE yet but I see no reason why it shouldn't.

Now to figure out how to run it from my hdd with the pffdata.js file on MyWay. :)

Re: FireFox link error

Posted: 25 Mar 2013, 05:09
by Ed_P
Actually the answer is:

Code: Select all

var todayDay = "";
function todayDate() {
var result="";
if ((clid==0)||(typeof(pffdata) == "undefined")){
var now=new Date();
// var y=now.getYear()+"";
var y=now.getFullYear()+"";
// http://stackoverflow.com/questions/98124/why-does-javascript-getyear-return-108
var yy=y.substring(2,4);
// alert ("now="+now+"\n y="+y+"\n yy="+yy);
if (navigator.userAgent.indexOf("Firefox")!=-1){
yy = LZ(yy);
}
And if the URL doesn't specify the clid operand the pffdata.js file is not an issue getting the current game. :D

Re: FireFox link error

Posted: 25 Mar 2013, 05:16
by Hamza
Good :)