Comments (62)
That's the URL with an empty searchfield here:
https://www.geocaching.com/play/search?ot=4
and with some input in the field:
https://www.geocaching.com/play/search/@48.249183,14.31865?origin=N+48%c2%b0+14.951%27+E+14%c2%b0+19.119%27
a little weird
from send2cgeo.
After using my not so deep java knowledge I found the following:
- The premium check at the beginning of the script seems to work and set
premium
accordingly - However this variable does not survive into this line where I can see that
window.premium
always returnsundefined
.
I am sure someone with java knowledge can solve it, however I failed in several tries.
from send2cgeo.
addon version 0.38 stopped working here too. reinstall and registration did not solve this
from send2cgeo.
Same issue here.
After checking the script i changed in line 2 'li-membership' to 'li-upgrade'
var premium = document.getElementsByClassName('li-upgrade')[0];
Now it's working again
Firefox 54.0 / Kubuntu
from send2cgeo.
@geronimo0812 do you have a premium?
from send2cgeo.
No, i didn't.
Oh I see, you changed the code for both accounts. Thanks
from send2cgeo.
I am Geocaching.com Premium and i use firefox 53 and 54 on both ystems send2c:geo didn't work since the update on yesterday. The Send to cego Button is not shown on the cachelisting or at the map.
after checkign send2c:geo homepage my phone and my browser are registred, all looking fine, but without the buttons i can't send a cacheliting to c:geo.
Grettings Wulfman_Do
Germany
from send2cgeo.
@WulfmanDo can you check with this change? Press "view", then "raw" and it should show you the installation page.
Or at least if you can, open the webpage (searching geocaches, e.g. this) and paste the source here via gist or pastebin. It'll at least give a basic idea about what's wrong with it.
from send2cgeo.
@ KeyWeeUsr ok, i have install the ne script like you told, the installtion menü pops up and told me installtion was suscsseful. I open a cachelisting, but no button. I close firefox and start it again, i open a new cache - no button, i opne the map, no link to send to c:geo
from send2cgeo.
Here the html sourcecode of a new tradional cache: GC77XFQ
from send2cgeo.
Here i add it at pastbin :
from send2cgeo.
@WulfmanDo Ok, the li-upgrade
part is the same part of the page the script is checking for, so it should be ok for column buttons in the page I linked i.e. you should see this:
Reinstall from here again.
I'm not sure what's the i opne the map, no link to send to c:geo
means. Was there some button for the map too? Any screenshot? I just remember that it had that column with buttons and I used only that.
Same for i open a new cache - no button
i.e. was there any button in a cache separately?
Edit: Apparently I missed them completely. anyway, both work correctly, I think?
from send2cgeo.
I didn't see the column you marked in the image above.
To make it visible I removed the slash in the URL in the following line in the script:
// @include https://www.geocaching.com/play/search*
Then the column is visible
from send2cgeo.
@geronimo0812 removing probably nah, but adding might be a better solution (if you remove, it might break later) → now?
from send2cgeo.
Ok agree.
I added it and it also works. but there must be an asterisk at the end! Without it doesn't work.
from send2cgeo.
Updated. It seems kind of weird though, because URL is with the slash https://www.geocaching.com/play/search/@34.01843,-116.16424?origin=blob
.
from send2cgeo.
I check it again, no button or icon for send to c:geo. At the map im mean it the send to c:geo on the cache dtails popup. See attached pics..
from send2cgeo.
Hello,
I have seen you discussed a lot about this problem and I see a PR issued as fix for this issue.
Can you tell me the latest status, is the PR/fix considered working. In that case I would take care for merging/testing/publishing.
from send2cgeo.
Hello, i make a reinstall ( Post by KeyWeeUsr .... Reinstall from here again. ... )
and after a refresh of the browser it, works at the map and the cachelisting, but NOT at the Searchlist, see pictures:
Looks good and working fine, after click the send buttopn the succses popup appears and i check it at the phone, download ist working too.
from send2cgeo.
@WulfmanDo yeah, I should have changed the link. It's missing the line @geronimo0812 warned me about. This with the latest change, it should be fine :)
from send2cgeo.
I merged #37 for testing.
I can confirm that all functions are OK, however there is one scenario where the button is missing:
- Premium member on search results page
The same search result page for basic members is showing the button. So I guess there is still some problem in the PM detection.
@KeyWeeUsr I tested with the script on master
branch here. Any idea, what is missing?
from send2cgeo.
@Lineflyer include line probably in some shape like this. What is the URL exactly?
Edit: Or is it the same thing Wulf described with the last screenshot?
from send2cgeo.
I think it is the same thing.
The URL should be already included according to the script:
https://www.geocaching.com/play/search/@51.340667,7.043983?origin=N+51%c2%b0+20.440%27+E+7%c2%b0+2.639%27
For the same URL the button is appearing if I login as basic member.
So I guess it is some problem with the differentiation between BM and PM and that search page.
from send2cgeo.
@Lineflyer could you look at the console output when you refresh the page i.e. if it's something wrong in there? Also I have another theory and that's that the children were actually in there (I have no clue how premium page looks like except the linked source above), so try to add:
} else {
premium = true;
}
at this line and see if something happens. A premium member shouldn't have Upgrade
text anywhere I believe, so even if the check for children passed, the other one wouldn't. Anyway, afaik, it should work even this way, because the check later is just if (window.premium)
which should be true in that case. O_o
from send2cgeo.
@KeyWeeUsr
As I am not really familiar with coding I don't really understand what you mean.
AFAICS there is already this else
case contained at the line you are refering to.
Maybe its easier you provide me a link to a changed script in your repo so I can test with it and report back.
from send2cgeo.
Here is a HTML of a search result page for premium members:
https://gist.github.com/Lineflyer/d6291ce0c9f56c5f809f97a44224bae6
from send2cgeo.
@Lineflyer it appears that the premium members either have a <li class="li-upgrade">
element present on some pages or they don't have any of those we look for present at all. So I just set it to be premium = true
by default if it doesn't find any of the elements. Please test it with the new PR, it should be ok now.
from send2cgeo.
@KeyWeeUsr Thanks for debugging.
I merged your PR and tested with the resulting script.
Now the detection seems OK, but we have a style problem in search results:
For basic members it looks OK:
But for PM the rows seems to be not well formatted (also note the swapped titles):
I am sorry, that I cannot help.
Can you take a look again?
from send2cgeo.
Apparently the premium one protests now. Basically it's only the titles, because the Geocache Name
has fixed size and Send to c:geo
too, so this just swapped the headers and it crippled itself appropriately. Imagine it like Excel columns - the content of the rows is just behaving like the header/column name ^^
The culprit here is the column of checkboxes a basic member doesn't have (the left side). Those lines just place the column header after the first element, which for premium member are the checkboxes. Try with the new PR.
from send2cgeo.
I tried with PR #39 but the behaviour is unchanged as described above (BM OK, PM still colums in wrong order, no difference to above screenshots).
from send2cgeo.
@Lineflyer are you sure? On the other hand, why did you merge it if it didn't work? I mean, you could just install it from the PR (Files changed
, View
, Raw
, Install
). Please try again and if you can, paste even the console output if there's any (Firefox -> F12 -> Console; not sure about Chrome) and also the source of the page(after the greasemonkey script runs).
from send2cgeo.
Hi, I'm new on GitHub - just signed up for posting my solution for the problem.
I found out that there is also a JS Object from GC.com that provides the member state - so I replaced the the membership check by the following lines:
if (typeof serverParameters != "undefined") { // Object in all included-above gc pages except geocaching.com/map
if (serverParameters["user:info"].userType == 'Premium') {
premium = true;
} else {
premium = false;
}
} else if (typeof listResources != "undefined") { // Object on GC Map page (geocaching.com/map/*
if (listResources.isPremium == 'true') {
premium = true;
} else {
premium = false;
}
}
testing enviroments:
FF 55 DevEdition x64, greasemonkey and GC Premium membership
FF 54 x86, greasemonkey, GC Basic membership
I used 2 different browsers so I could be signed into different GC accounts at once.
Works on both enviroments as it should, except with the same weird view on the search page like @Lineflyer mentioned above.
By troubleshooting the error I have also used tampermonkey for Firefox, works on every page, too and it also switch the columns on the search page, but it looks much better:
from send2cgeo.
@KeyWeeUsr What do you think about @BMWHoizer proposal regarding membership state checking? Looks IMHO more clean and safe.
@BMWHoizer
Thanks for investigating.
If I understand you correct, using Greasemonkey you also have the mixed-up columns in the search view, but not when using Tampermonkey with the same script?
from send2cgeo.
@Lineflyer in tampermonkey the columns are also switched, but not out of alignment like in your screenshot - see the screenshot I have attached in my comment above. It's taken while using tampermonkey on GC Premium account.
from send2cgeo.
@Lineflyer The code looks good to me and is better... well, at least until the JSON is still visible in the code. Maybe it's a connection between server-client, maybe just someone forgot to clean the production code. Anyway, if it works, why not? :) Although I like the original placement more, because especially on premium it looks weird with too many pictures close to each other.
from send2cgeo.
I have the send2cgeo button again in the cache pages, but when I click on it, it says I have to register first... which I did... so there's still something wrong somewhere.
from send2cgeo.
@KeyWeeUsr @BMWHoizer
How shall we proceed with that?
I tend towards releasing the current status of master
as verion 0.39 asap.
Doing so we have a working model out in the field with only the glitch of the non working view for PM in list view which we can tackle afterwards.
Also discussing the change of PM-detection can be done seperately IMHO.
I will go forward and test the current version for another time and then (unless someone stops me) merge to release to push the update on the market.
from send2cgeo.
@Lineflyer Well, I can't really test it with premium accounts, so there's the problem for me. On the other hand, if the only thing wrong with my fix on the webpage is the main search page for the premium users, just try to add
console.log(<something>);
in there to check what condition didn't pass i.e. what "broke" for the premium membership check. Or test the @BMWHoizer's solution and see how it goes. :)
from send2cgeo.
Thanks for the console.log
hint. I am still debugging.
Question: Are you sure window.premium
is correct to check the premium status? I looks to me like premium detection is working normal, but still only the basic scenario is executed later on.
from send2cgeo.
@SnarkBoojum have you a few more informations for us? Used browser, greasemonkey or tampermonkey, GC PM or BM? I assume that you have registered the used browser AND the g:ceo app? Maybe registering the app once again can help.
@KeyWeeUsr I have a premium account and a basic account but i can only test it with Firefox ( I don't like chrome ;-) ). I've already tested the script with my modifications on BM and PM in FF54 x64 and it works without any errors, except the weird view on the list page. IMHO you can release a new version with the working membership check, so the script would works at least, even with the weird view on the list page.
Actually it seems that no one can use it without setting the membership state manually in the script.
Is it possible to get an pre-release of the 0.39 for testing?
from send2cgeo.
@BMWHoizer
You can download the actual status by calling the raw file on master
with this link:
https://github.com/cgeo/send2cgeo/raw/master/send2cgeo.user.js
I think I have a solution for the weird view, which only fails as the premium detection is not working. See my posting above. The variable premium
aka window.premium
is not working I assume.
from send2cgeo.
@Lineflyer thanks for the info - I will load it for testing.
Regarding window.premium: That seems that the old GC page has used the window
object to set an attribute called premium
to define the premium membership, which was removed. Because window
has no attribute called premium
by default.
from send2cgeo.
I have little understanding of Greasemonkey and Java.
As far as I read window.premium
should represent the variable premium
set in the script but not any global page variable.
from send2cgeo.
do you mean Java or rather JavaScript? There is a difference :-)
from send2cgeo.
Take a look at the console log running this script as PM:
https://github.com/Lineflyer/send2cgeo/raw/3165d28b2f3755dafd5917382e21263e2b9f267f/send2cgeo.user.js
It shows that premium detection is OK, but later it fails to use it.
from send2cgeo.
I see - but what is the sense of
if (premium != true && premium.children.length) {
premium has prior set to a boolean value (true or false)
from send2cgeo.
That would be a question to @KeyWeeUsr as he authored this part AFAIR.
I just tookover that part.
However even if I use your check, it wont work.
from send2cgeo.
The browser is chromium 59, using tampermonkey. I am not premium, and the send2cgeo webpage says the browser is registered, and the device is too.
from send2cgeo.
what is the sense of
if (premium != true && premium.children.length)
premium
doesn't store only a boolean value, that's the point. See lines #35 and #37 and as Javascript executes the condition in that order, I check if premium
by any chance isn't true. If it is, then the length
attribute will break the script. It's a rather "hidden" condition if the object has that particular attribute almost without touching it.
@Lineflyer about that window.premium
, the main reason for that particular way of checking was to check before the script even runs the code for changing the layout, but apparently it can't go that way. window
is just a global object I used to store a variable, nothing else, but apparently the window
's content is cleaned when the <script>
tag is executing, which makes sense for the window.premium == undefined
. Silly me, I didn't notice it.
That can be easily fixed with pushing the function into the <script>
tag and calling it manually.
@Lineflyer @SnarkBoojum try to install from here and see if it fixes the issue.
from send2cgeo.
Nope : still asking me to register first :-/
from send2cgeo.
I meant the column of buttons position, not the registering thingy. :) Most likely that's a completely different bug. Still, I can't reproduce it and iirc, the connection between the device and the website is handled through cookies, so make sure you have those enabled. The best thing would be to run your browser in a "safe mode" - for chrome try this.
from send2cgeo.
"Registration" leaves a cookie on your computer. If you don't make a registration or you delete a cookie you will not be able to run send2.
Go to http://send2.cgeo.org/ and a liitle bit down click "register browser".
from send2cgeo.
The send2cgeo pages says I'm registered (and knows the name I gave to the browser) and the phone too (and knows the name I gave of the phone), but the geocaching.com "send2cgeo" buttons keeps telling I should register first.
from send2cgeo.
Do you have 3-rd party cookies enabled?
https://support.mozilla.org/en-US/kb/disable-third-party-cookies
from send2cgeo.
I use chrome ; which site should I enable to make things work?
from send2cgeo.
from send2cgeo.
@KeyWeeUsr Thanks for providing the function. Now its working and so I could use the PM check to adjust the columns depending on user type.
PR will follow.
from send2cgeo.
@KeyWeeUsr @BMWHoizer
Please kindly check the version from current master
(v0.40):
https://github.com/cgeo/send2cgeo/raw/master/send2cgeo.user.js
For me it fixes PM-detection as well as wrong columns.
from send2cgeo.
@SnarkBoojum
This issue was dealing with a fix for non appearing send2cgeo icon in general.
Your problem seems to be the allowance of third-party cookies (as described by @mucek4).
from send2cgeo.
Disabling thing party cookies made it work, but I didn't find which exception to enable to make it work, so that needs some poking around.
from send2cgeo.
That was https://send2.cgeo.org ! Opening another issue, then.
from send2cgeo.
sorry for my late reply.
I have tested V0.40 on FF54 with tampermonkey on PM and BM and can confirm that it works technically.
The columns are also fixed but know it seems that there is a row error on Premium Caches in BM list view.
It also exists while using greasemonkey.
But I think that should be cleared in a new issue.
Best regards and thanks for fixing
BMWHoizer
from send2cgeo.
Related Issues (20)
- Next release send2cgeo HOT 4
- Remove no longer used OC scripts from repo
- Add Owner Dashboard HOT 1
- Script crashed, if a cache have a comment
- Retrieve icon from website ressource HOT 3
- s2cg button doesn't appear immediately on new map
- Result window not visible HOT 2
- Send2cgeo release HOT 4
- support send2cegeo for more opencaching sites HOT 1
- Wrong place for s2cg Button on BML after changes by GS HOT 1
- Add "Send2cgeo" to right click menu of caches at the live map HOT 2
- The cookie "browser_code" will soon be rejected (firefox) HOT 4
- Columns are moved ugly on search page if member is a basic member. HOT 5
- Send2cgeo issue HOT 4
- S2cg does not work on new Results of Search Page
- not working on cgeo_legacy HOT 1
- Columns unaligned on owned caches list if website runs in Italian language HOT 1
- Support to edit/add waypoints, set personal notes from browser using send2cgeo HOT 3
- s2cg is not going past "register first" HOT 45
- autoTour from GCTour crashed because of c2cgeo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from send2cgeo.