Post here if you are a new Porteus member and you're looking for some help.
-
Hamza
- Warlord

- Posts: 1908
- Joined: 28 Dec 2010, 07:41
- Distribution: Porteus
- Location: France
Post#31
by Hamza » 19 Mar 2013, 10:01
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

NjVFQzY2Rg==
Hamza
-
Ed_P
- Contributor

- Posts: 7908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.0 ISO
- Location: Western NY, USA
Post#32
by Ed_P » 19 Mar 2013, 18:56
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.
Ed
Ed_P
-
Hamza
- Warlord

- Posts: 1908
- Joined: 28 Dec 2010, 07:41
- Distribution: Porteus
- Location: France
Post#33
by Hamza » 19 Mar 2013, 20:36
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?
NjVFQzY2Rg==
Hamza
-
Ed_P
- Contributor

- Posts: 7908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.0 ISO
- Location: Western NY, USA
Post#34
by Ed_P » 20 Mar 2013, 03:56
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?
Ed
Ed_P
-
Hamza
- Warlord

- Posts: 1908
- Joined: 28 Dec 2010, 07:41
- Distribution: Porteus
- Location: France
Post#35
by Hamza » 20 Mar 2013, 11:12
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
NjVFQzY2Rg==
Hamza
-
Ed_P
- Contributor

- Posts: 7908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.0 ISO
- Location: Western NY, USA
Post#36
by Ed_P » 20 Mar 2013, 14:56
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.
Ed
Ed_P
-
Hamza
- Warlord

- Posts: 1908
- Joined: 28 Dec 2010, 07:41
- Distribution: Porteus
- Location: France
Post#37
by Hamza » 20 Mar 2013, 17:34
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.
NjVFQzY2Rg==
Hamza
-
Ed_P
- Contributor

- Posts: 7908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.0 ISO
- Location: Western NY, USA
Post#38
by Ed_P » 20 Mar 2013, 17:44
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.
Ed
Ed_P
-
Hamza
- Warlord

- Posts: 1908
- Joined: 28 Dec 2010, 07:41
- Distribution: Porteus
- Location: France
Post#39
by Hamza » 20 Mar 2013, 18:14
No, as previously said. The check is done on a part you can't control which is JavaScript core.
NjVFQzY2Rg==
Hamza
-
Ed_P
- Contributor

- Posts: 7908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.0 ISO
- Location: Western NY, USA
Post#40
by Ed_P » 23 Mar 2013, 19:36
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.

Ed
Ed_P
-
Ed_P
- Contributor

- Posts: 7908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.0 ISO
- Location: Western NY, USA
Post#41
by Ed_P » 25 Mar 2013, 05:09
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.

Ed
Ed_P
-
Hamza
- Warlord

- Posts: 1908
- Joined: 28 Dec 2010, 07:41
- Distribution: Porteus
- Location: France
Post#42
by Hamza » 25 Mar 2013, 05:16
Good

NjVFQzY2Rg==
Hamza