3. However I think that looking for 'this.select(); value=' is the safe way, b/c that is what is copied to the clipboard if the user selects it.
O, wow. That html-code really has some differences from mine (attached).
I wouldn't check on 'this.select(); value=' because in my case there is " type="text" readonly="readonly" in between there. And there could be for your users too. In your case I would only check for
value= and optionally remove " or ' if they are around the result.
Your code even has an invalid onclick-javascript. It should be surounded by " or ' (shouldn't it?).
<INPUT style="WIDTH: 300px" id=code onclick=this.focus();this.select(); value=4/vD6ZfA6444pVKWI............D5fRTCLqpGD6fReg readOnly type=text>
So best is to go for the browser title and if that doesn't work go for
value=?xxxx? (where ? could or could not be " or ').
I showed you my change in the 2nd last attachment, that should accomplish that:
if UseBrowserTitle then begin
Found := Browser.LocationName;
Authorize_token := Copy(Found, Length(SearchFor) + 1, 1000);
DebugLine('Authorization: We used the browser-title');
end; ;
if Authorize_token = '' then begin
<do the html stuff>
Yep. That's a useful addition. However if the code is cut off in the browser-title (which it once was for me) the check for html would not be done (because Authorize_token <> '' but invalid). So retrieving both and checking the browser-title code and if that one is not correct use the html-body one is the safest way.
But then again... maybe the whole html-body check isn't necessary anymore (if Google fixed it). This was, if I remember correctly, when the code could contain invalid url-characters like & and +. In that case there was a problem retrieving it. But I haven't seen that in a long time.