same-origin-policy

Request external website data using jQuery ajax

丶灬走出姿态 提交于 2019-12-06 09:12:12
问题 I've tried reading up about this and not really sure where to start, so hoping somebody will be able to point me in the right direction. Basically I'm trying to use jQuery ajax to read an external website and retrieve a list of links from it. No particular reason as such at the moment, just wanted to see if I could challenge myself by doing it. In doing so I've read up a little about the Same Origin Policy and understand it (sort of) but could do with some pointers. Is this possible to do? I

How do I bypass a same origin policy violation for one local file to another?

╄→гoц情女王★ 提交于 2019-12-06 07:01:32
问题 I'm trying to semi-recreate Mozilla's demo usage of JavaScript + <video> + <canvas> with files that aren't hosted on a server. Loading my document causes the error console to report this error: Error: uncaught exception: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: "file:///media/disk/javascript/html5/chromakey/chromakey1.htm Line: 23"] Here's line 23: this.referenceImageData = this.bCtx.getImageData(0, 0, this.bufferCanvas.width,

Access-Control-Allow-Origin header when Origin 'null' when trying to post data to a LOCAL application

我们两清 提交于 2019-12-06 06:06:30
I'm working on a program which will help interface with your bitcoin wallet via the browser. By setting up the bitcoin client as a server with the following commands in it's .conf file... server=1 rpcuser=test rpcpassword=test rpcallowip=127.0.0.1 It will allow it to run as a server and thus let you post JSON commands at it. I've gotten this to work with the following code below. $.ajax({ url: 'http://test:test@127.0.0.1:29661', type: 'POST', contenType: 'application/json', cache:false, dataType:"json", data: '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }', timeout:

Which server needs to return Access-Control-Allow-Origin header?

て烟熏妆下的殇ゞ 提交于 2019-12-06 05:53:09
Let's say I have an HTML page, served up from example.com. It makes an javascript ajax request to targetServer.com Which server needs to return a Access-Control-Allow-Origin="(something)"? Is it the targetServer or the server that served up the original HTML page (i.e. example.com)? [I know this probably is obvious, but the docs on the web seem to imply the targetServer has to send and allow-origin header of "example.com" But if this is a security feature, wouldn't a malicious targetServer.com always serve up a suitable allow-origin header? It sort of makes sense that example.com would give

Calling parent window method from Iframe (different)

冷暖自知 提交于 2019-12-06 04:29:02
I have a page on a domain: http://main.mydomain.com/frame.cfm which holds an iframe, loading a domain http://www.anotherdomain.com . This page http://www.anotherdomain.com has a script reference to http://sub.mydomain.com/somescript.js This somescript is a tracking script like google Analytics, which loads with each request of www.anotherdomain.com. At a certain stage, the script http://sub.mydomain.com/somescript.js in the page www.anotherdomain.com will try to call window.top.aFunction(); or parent.aFunction(); to make the parent window do something. I know about the X-Frame-Options and the

Chrome Extension: how to change origin in AJAX request header?

自闭症网瘾萝莉.ら 提交于 2019-12-06 00:28:19
问题 I'm trying to manually set an origin in an ajax request header. In my background.js, I have this var ajaxResponse; $.ajax({ type:'POST', url:'www.somewebsite.com/login/login.asp', headers:{ 'origin': 'https://www.somewebsite.com' }, success: function(response){ ajaxResponse = response; } }); As you can see, the origin is changed. But when this Chrome extension get executed, the origin gets override to chrome-extension://iphajdjhoofhlpldiilkujgommcolacc and the console gives error 'Refused to

Is it safe to have sandbox=“allow-scripts allow-popups allow-same-origin” on <iframe />?

会有一股神秘感。 提交于 2019-12-06 00:18:54
I'm dynamically creating an iframe in my app, result looks as follows: <iframe src="blob:http%3A//localhost%3A9292/0194dfed-6255-4029-a767-c60156f3d359" scrolling="no" sandbox="allow-scripts allow-popups allow-same-origin" name="sandbox" style="width: 100%; height: 100%; border: 0px;"></iframe> Is it safe to have such sandbox configuration (especially allowing the iframe content to be treated as being from the same origin)? allow-same-origin is not safe. That will give the iframe the possibility to access parent data (also local storage for example) Also allow-same-origin will allow the iframe

Catching same origin exception in Javascript?

一个人想着一个人 提交于 2019-12-06 00:01:52
I'm trying to create my own XMLHttpRequest framework to learn how this things work internally. A thing that puzzles me is that I cannot find how to catch a "Same origin" exception. The idea behind this is that I try to load a URL, if I get a Same origin exception, I re-request the URL through a proxy script local for the script. The reason I do this is because I need to access production data from a development sandbox and I want it to be as transparent as possible for the script itself. I know it's a bad practice but this is the least intrusive way of doing this at the moment :) Just to clear

GWT-RPC and the infamous sporadic “StatusCodeException: 0” exception revisited

耗尽温柔 提交于 2019-12-05 23:14:40
问题 My problem is the infamous "StatusCodeException: 0" problem happening when using GWT 2.6.1 when accessing page via subdomain https://sub.site.com/ . Now, this happens quite sporadically for one customer using IE11 and I can't reproduce this from several distinct computers using IE11, IE10, IE9 or IE8 (not to talk about Chrome or Firefox). Accessing exactly the same webapp from https://site.com/ seems to work fine for that customer. This obviously lead me to conclusion that I'm having problem

Web API 2 project and MVC 5 Website project in same domain

非 Y 不嫁゛ 提交于 2019-12-05 10:42:21
Technologies used: BreezeJS OData Web API 2 MVC 5 IDE: Visual Studio 2013 I've been wrestling with the idea of having a Web API project and a separate web site project in a single solution. My Web API 2 project opens up as: localhost:2020/ExampleProject.API My MVC 5 WebSite project opens up as: localhost:5050/ExampleProject.WebSite Now by default web api doesn't allow cross origin policies. So I played around with enabling CORS in my Web API 2, although I was able to get it to work, it only works for the latest browsers; I need the backward compatibility of IE7 to IE9. So I played around with