I am following this code sample to create my own CORS-proxy server. It works fine but when I click a link, I go to an invalid link.
Say, I loaded localhost:1377/?url=www.github.com in my server, the page loads.
But when I click any link (say open-source), I end up going to http://localhost:1337/open-source rather than localhost:1337/?url=http://www.github.com/open-source
How can I handle the requests to stay within my proxy server and keep browsing?
Thanks
Edit: Pictures
Because of anchor tag of Open Source link. You need to parse the DOM.
Related
I currently have a bokeh_app.py file deployed and running absolutely fine
It is accessed by anyone in the network via URL HostName:PortNumber/bokeh_app
I want to add code which will make the app work via following URL
HostName:PortNumber/bokeh_app/?textboxvalue
And the page that would open is HostName:PortNumber/bokeh_app with updated Text box value to textboxvalue from the URL
What would be the changes I need to make to my code to achieve this, if possible. Please suggest
Accessing HTTP request arguments is covered in the documentation:
https://docs.bokeh.org/en/latest/docs/user_guide/server.html#accessing-the-http-request
In a system I have to maintain (didn't build it, just inherited it) we have a Foursquare implementation that hasn't been used in quite a while. Trying to revive it failed, because our page is now loaded via HTTPS, which it didn't used to be.
We are using the "Save to Foursquare" button as well as the API request to retrieve the number of Check-ins. I already switched all the JS includes and intent links from http to https and at least now it shows the number and the button correctly.
However, I can't click the button and checking the browser's console I found that it added a script tag to the head of this page which tries to access http://platform.foursquare.com/js/modules/widgets.asyncbundle.js. The browser obviously blocks this, because it's not using HTTPS.
The file we are explicitly loading is https://platform.foursquare.com/js/widgets.js. It seems to me like this script is not reacting correctly to HTTP vs. HTTPS. There is probably a very simple solution to this, so what am I missing?
I don't know if you've tried it yet but the foursquare website says this on the matter:
Change the source of the JavaScript file to https://platform-s.foursquare.com/js/widgets.js
Add {"secure":true} to the global configuration block (window.___fourSq)`
The same link (see below) has all the different ways to call the Save To Foursquare function using its .saveTo() function.
https://developer.foursquare.com/overview/widgets
I hope this information and links helps! Cheers.
in my application particular URL displays the JavaScript source used in our project.For >https://example/faces/scripts/NameofJavaScript.js. It displays the java script mentioned in the URL as save or open option.please let me know about this issue.Is it Web server side issue or Application side issue.how to resolve this issue.I am using Java with Jsf. Thanks in advance.
You can't stop people from viewing your JavaScript code sadly; as it's a client side language, however if you were to use PHP or ASP.Net for example, the code would be hidden as it's server side.
Client Side - View able
Server Side - Hidden
Basic rules I go by anyway
I know there's a way for extensions and pages to communicate locally, but I need to send a message from an outside URL, have my Chrome Extension listen for it.
I have tried easyXDM in the background page, but it seems to stop listening after awhile, as if Google "turns off" the Javascript in the background page after awhile.
I think you may try some walk around and build a site with some specific data structure, and then implement a content script which will look for this specific that specific data structure, and when i finds one it can fetch the data you want to be passed to your extension.
Yes, you need a content script that communicates with the page using DOM Events.. Instructions on how to do that are here:
http://code.google.com/chrome/extensions/content_scripts.html#host-page-communication
I'm trying to write a userscript/Chrome extension to capture JSON data being sent while using a web service so that I can reformat it and display selected portion on page. Currently the JSON is sent as the application loads (as I've observed from watching traffic with Fiddler 2). Is my only option to request the JSON again or is capture possible? As I'm not providing a code example, a requested answer is even some guidance on what method / topic to research or if I'm barking up the wrong tree.
No easy way.
If it is for a specific site you might look into intercepting and overwriting part of a code which sends a request. For example if it is sent on a button click you can replace existing click handler with your own implementation.
You can also try to make a proxy for XMLHttpRequest. Not sure if this even possible, never seen a working example. You can look at some attempts here.
For all these tasks you probably would need to run your javascript code out of sandboxed content script to be able to access parent page variables, so you would need to inject <script> tag with your code right into the page from a content script: