Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

document.cookie doesn't work for https://httpbin.org/cookies site in Firefox

  • 4 trả lời
  • 1 gặp vấn đề này
  • 15 lượt xem
  • Trả lời mới nhất được viết bởi TinyFox

more options

I am using `Firefox 73.0.1 (64-bit)` Windows7.

`document.cookie = "name=value"` can't add new cookie in Firefox for this site `https://httpbin.org/cookies` but Chrome does.

I tried with latest Firefox installation with MacOS, it neither add a new cookie.

Could you tell me why? Thanks

I am using `Firefox 73.0.1 (64-bit)` Windows7. `document.cookie = "name=value"` can't add new cookie in Firefox for this site `https://httpbin.org/cookies` but Chrome does. I tried with latest Firefox installation with MacOS, it neither add a new cookie. Could you tell me why? Thanks

Được chỉnh sửa bởi TinyFox vào

Giải pháp được chọn

The https://httpbin.org/cookies file appears to be a JSON file containing a cookies object. Firefox renders this page in a viewer rather than in raw text form. You may need to disable the viewer first before testing:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

(2) In the search box above the list, type or paste json and pause while the list is filtered

(3) Double-click the devtools.jsonview.enabled preference to switch the value from true to false

Đọc câu trả lời này trong ngữ cảnh 👍 1

Tất cả các câu trả lời (4)

more options

Hi TinyFox, if you check the Web Console in the developer tools for that tab, does it mention any errors, warnings, or policy restrictions when the script in the page is run?

Ref. https://developer.mozilla.org/docs/Tools/Web_Console

more options

jscher2000 said

Hi TinyFox, if you check the Web Console in the developer tools for that tab, does it mention any errors, warnings, or policy restrictions when the script in the page is run? Ref. https://developer.mozilla.org/docs/Tools/Web_Console

It only has this on the Console tab. Is it related to that problem I mentioned? I don't think so.

Content Security Policy: The page’s settings blocked the loading of a resource at https://httpbin.org/favicon.ico (“default-src”).

You can try with your browser, can you add cookie ?

more options

Giải pháp được chọn

The https://httpbin.org/cookies file appears to be a JSON file containing a cookies object. Firefox renders this page in a viewer rather than in raw text form. You may need to disable the viewer first before testing:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

(2) In the search box above the list, type or paste json and pause while the list is filtered

(3) Double-click the devtools.jsonview.enabled preference to switch the value from true to false

more options

jscher2000 said

The https://httpbin.org/cookies file appears to be a JSON file containing a cookies object. Firefox renders this page in a viewer rather than in raw text form. You may need to disable the viewer first before testing: (1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk. (2) In the search box above the list, type or paste json and pause while the list is filtered (3) Double-click the devtools.jsonview.enabled preference to switch the value from true to false

You are genius :P