same-origin-policy

Display Javascript “same origin policy” violations

坚强是说给别人听的谎言 提交于 2019-12-12 06:56:23
问题 I'm developing a mobile app which runs a simple HTTP server and a WebView. The WebView displays an external website which should access the server via javascript (GET). Unfortunately this doesn't work and I assume it's due to the same origin policy but the console doesn't show any errors. I had a similar error before which required me to define "Access-Control-Allow-Origin: *" on the server side. This error already took a while to find because there were no error messages (Firebug "Net" tab

Cordova or Phonegap Http Requests and Same Origin Policy Problems

痞子三分冷 提交于 2019-12-12 03:35:19
问题 As so many others I have the problem with a RESTful service we are calling. This service as so many others has an ORIGIN check. Using Cordova & Ionic doing the request from android app set the origin to file:// which is good for browser cors check but not good for the service, they doesn't allow this schema for origin. As others the allow only empty origin or the same origin. On many posts I read the wrote you can handle this with whitelist plugin or with CSP. But I think this absolutly

Bypassing the AJAX Same-Origin Policy - A particular case

你离开我真会死。 提交于 2019-12-12 01:57:59
问题 While I was trying to refresh page contents dynamically using Ajax/JQuery, I have learned about the S-O-P issue and restrictions, however I was wondering if there could be a way to solve my little problem. To make it easier to understand I will first explain the workflow. I do receive web pages via email, that is HTML emails. The web pages contain HTML forms in such a way, once the form is complete it is sent to the proper web server (php) to store data. I mostly use Outlook 2007 as my email

AJAX Status Code 0 with php proxy

落花浮王杯 提交于 2019-12-12 01:22:56
问题 I have this ajax web application I am developing that essentially calls the google moderator api using ajax and returns the result to do something with them. I know that AJAX cannot make cross domain requests itself so I have also put in a web server based php proxy using cURL to take in the URLs, make the request and send back the data. The problem I have is that no matter what I do, every request I make returns in a Http status code of 0. I am not entirely sure what a code of 0 really means

Ways to circumvent the same-origin policy

╄→尐↘猪︶ㄣ 提交于 2019-12-12 01:19:31
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. The same origin policy I wanted to make a community wiki regarding HTML/JS same-origin policies to hopefully help anyone searching for this topic. This is one of the most searched-for topics on SO and there is no consolidated wiki for it so here I go :) The same origin policy prevents a document or script loaded from

How do I set a cookie for an iframe with a different domain?

跟風遠走 提交于 2019-12-12 01:16:21
问题 I need to construct a page that contains an iframe that in turn shows a page from an AWS service. Constructing a parent page that contains such an iframe is no problem. I need to access the DOM of the AWS page from the parent page but the Same Domain Policy prevents me from doing this so I have had to write code to serve as a proxy that fetches and returns the page HTML of the AWS service. So, my server returns the parent page which contains an iframe that in turn requests another page from

How to get Google results into our webpage without SAME ORIGIN POLICY

百般思念 提交于 2019-12-11 22:38:37
问题 We have own form in our webpage. We want to show google( www.google.com/scholar ) results into our webpage. We tried jQuery, Ajax HTML framing (iFrame, frameset) and all of these have SAMEORIGIN issues. We also tried using a new tab and found it has same problem here . All these solutions seem to work only with http://www.google.com/custom and no other google websites. Is there any alternative to do so? 回答1: Google prevents you from doing this. You could set up some server side code to scrape

CORS and web extensions

孤街浪徒 提交于 2019-12-11 22:15:09
问题 I set up a server on http://localhost:8080 where http://example.com can do POST requests : 'use strict'; const express = require('express'); const app = express(); const port = 8080; // allowing CORS for example.com app.use('/', function (req, res, next) { res.header('Access-Control-Allow-Origin', 'http://example.com'); if (req.method === 'OPTIONS') { res.header('Access-Control-Allow-Methods', 'OPTIONS, POST'); res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length'); res

SecurityError: Permission denied to access property on cross-origin object laravel/javascript

我的梦境 提交于 2019-12-11 19:46:25
问题 I have a laravel app. i have two urls Route::get('/', function () { return view('welcome'); }); Route::get('/pdf', function () { $headers = [ 'Access-Control-Allow-Origin' => 'http://cms.test' ]; return response()->file('test.pdf', $headers); }); inside welcome i have added an iframe <iframe src="{{ url('pdf') }}" width="100%" height="80%" id="test_frame" ></iframe> now when i do window.frames["test_frame"].contentWindow it gives Restricted http://cms.test/pdf:Object and when i try to access

Why is there a need for the Same-origin policy (SOP)?

时间秒杀一切 提交于 2019-12-11 12:44:19
问题 I did read a lot about SOP. What it does, and how it works, for example here in Wikipedia: http://en.wikipedia.org/wiki/Same-origin_policy And I can often read, that the SOP is an important element of security in browsers and web-applications, that prevents attack. My problem is: I can't think of any scenario where a cross-domain access would be dangerous for anyone. Please can you describe at least one scenario that is prevented by SOP and would be a detriment for someone if it wasn't