same-origin-policy

JavaScript document.domain Uncaught DOMException: Blocked a frame with origin

。_饼干妹妹 提交于 2019-12-09 16:28:59
问题 While I was testing the SOP, i came to this scenario two documents has a relationship with the same domain as i would expected and it throws an error when i try to get the location. To reproduce the problem: Open https://www.google.com from the console let opened = window.open("https://www.google.com") from the same window do opened.location.toString() which will return the correct location from the second tab's console do document.domain = "www.google.com" from the first tab do opened

GWT HTTP request response code 0 with CORS working

橙三吉。 提交于 2019-12-09 13:51:21
问题 I am using GWT 2.4 to build an application that runs entirely client-side and uses a web service that I control but is hosted on a different server. On this Java Servlet web service, I have implemented doOptions like so: protected void doOptions(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.addHeader("Access-Control-Allow-Origin", "*"); response.addHeader("Access-Control-Allow-Methods", "POST, GET"); } And client-side in GWT I submit

How do REST APIs work with JavaScript when the same-origin policy exists for browsers?

空扰寡人 提交于 2019-12-09 04:08:44
问题 I am working with Flickr's REST API and it's working fine. By that, I mean I'm making an AJAX call to the Flickr API and getting a JSON object back, parsing the object, etc. etc. But this raises a question in my mind. If browsers follow the same-origin policy, then how can they make these types of API requests? This DEMO fiddle is working, but it sends a cross-domain request to the Flickr domain. How does this cross-domain request work? The cross-domain request: $.getJSON("http://api.flickr

Why doesn't this JavaScript call break the “same origin policy”

泪湿孤枕 提交于 2019-12-09 01:45:44
问题 I'm displaying an external JavaScript file using jQuery. Is the reason "same origin policy" is not being broken because it is not an AJAX request? http://jsfiddle.net/m7q3H/52/ Fiddle code : HTML <body> <div id="toupdate"> <script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/6343621.js"></script> </div> </body>​ jQuery $(document).ready(function() { console.log('HTML is '+$('#toupdate').html()); });​ 回答1: Oh absolutely no problem here. You could reference

Any hosted versions of jQuery that have the 'Access-Control-Allow-Origin: *' header set?

倾然丶 夕夏残阳落幕 提交于 2019-12-08 22:06:51
问题 I have been working with jQuery recently and ran into a problem where I couldn't include it in a userscript because XmlHttpRequest uses the same origin policy. After further testing I found that most browsers also support the Cross-Origin Resource Sharing access control defined by W3C as a workaround for issues with same origin policy. I tested this by hosting the jQuery script on a local web server that included the Access-Control-Allow-Origin: * http header, which allowed the script to be

How to solve Blocked a frame with origin from accessing a cross origin frame error in wordpress? [duplicate]

假装没事ソ 提交于 2019-12-08 18:46:22
问题 This question already has answers here : Cross domain iframe issue (4 answers) Closed 11 months ago . I am working on a WordPress website in which there are a lot of wordpress plugins installed. The plugins installed on the wordpress website has the following options: When I click on View details option, I am getting the blank screen as shown below in an image but when I open in a new window or tab, it works. On checking console, I am getting the following error ( when clicking on View

Same Origin Policy, Javascript/jQuery AJAX and retrieving an RSS XML feed

自古美人都是妖i 提交于 2019-12-08 14:20:20
问题 I came across a problem using jQuery to retrieve an RSS feed located on an external domain. It was working in Safari but other browsers would error because of Same Origin Policy restrictions (which are also documented about the $.ajax() function). Wanna know how I fixed it? 回答1: There are three ways to get around the Same-Origin Policy: Proxy -- as Strawberry Sheurbert did, perfectly effective but a waste of bandwidth and computing power JSONP -- loading the data through the script tag. Needs

How to bypass Cross origin policy [duplicate]

与世无争的帅哥 提交于 2019-12-08 14:18:10
问题 This question already has answers here : Ways to circumvent the same-origin policy (11 answers) Closed 4 years ago . Mobile app where it needs to get access to a JSON file in another server. And its showing cross origin policy blocked. So is there any way to bypass or have the access to the file ? 回答1: As already answered, you want a simple php proxy script. This way your server grabs the json file and you simply access your server from client side. . That way javascript is only dealing with

Laravel 4 refuses to load iframe due to 'X-Frame-Options' to 'SAMEORIGIN'

孤街醉人 提交于 2019-12-08 09:33:03
问题 I am building a chrome extension in which I am showing an iframe on a popup from the Gmail home page. As Gmail home page is in HTTPS , my iframe should also be in https. I configured apache2 by enabling mod_ssl and got HTTPS working on apache2. I made a native PHP page and tried to show that on the frame which is on Gmail page. I had no problems it was loading the page from localhost. But when I wanted to use a Laravel backend, it showed me error. Refused to display 'https://localhost/laravel

Same Origin Policy

↘锁芯ラ 提交于 2019-12-08 08:12:39
问题 I have read a bit about same origin policy over the last few hours and I understand a little bit of the idea but I have a question about my current setup. I have a page, we will call, foo.com/home and on that page is a link that opens up an iframe with a url of foo.com/home/bar . Now while in the frame of foo.com/home/bar if I were to have a hyperlink to say www.google.com when clicked can I have it redirect the iframe to Google without breaching the same origin policy? I wouldn't see the