chrome-php / chrome

Instrument headless chrome/chromium instances from PHP
MIT License
2.25k stars 276 forks source link

referer work or not? #596

Closed pitmans100 closed 8 months ago

pitmans100 commented 8 months ago

Hi, I'm trying to set up a referral but it's not working.

Tried this:

$referer = 'https://site.ru/';
$browserFactory->addHeader('referer', $referer);

Tried this:

$referer = 'https://site.ru/';
$referer_options = [
      'referer' => $referer
   ];
$navigation = $page->navigate($url, $referer_options)->waitForNavigation();

For some reason these two cases do not work, the referral is not installed, what am I doing wrong?

enricodias commented 8 months ago

See #530

pitmans100 commented 8 months ago

See #530

Yes, I saw this message, but I didn’t understand what needs to be written in code, can you give an example please?

enricodias commented 8 months ago

Like I said in the other ticket, apparently chrome ignores the referer header. That other ticket is still open because we don't have a solution.

pitmans100 commented 8 months ago

I managed to make a referral, on site you can see where referral came from. Now the only question is different, I make a referral with GET, example referal: https://site.ru/?uid=12341&yip=3456 But referral is still just a URL without a get: https://site.ru/