Comments (8)
Hmm... I think the preferred way of dealing with this is to return HTML and then do your network requests in javascript. This has the added benefit of automatically cleaning up the previous query's requests when the query changes. See the weather plugin for an example of this.
from flashlight.
@nate-parrott Yea, that's a good way, but during development, I found many of the APIs disallow cross domain xhr, which returns No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
while trying to fetch in JS. Any solution to this problem except setting up a proxy server?
from flashlight.
Hmm... looks like there's an undocumented switch you can flip on the Webview
. We're already using loads of undocumented APIs at it is, so this might be doable — although it might introduce security issues.
from flashlight.
Running a local proxy server is another alternative, but that'd be a bit of work...
from flashlight.
Actually, I might be mistaken here. Do cross-origin restrictions apply to content loaded by the local app into a webview, or is this just a problem for you during development? (in the browser)
from flashlight.
Thanks @nate-parrott , I succeeded running network requests in JS. As you said, there's no cross domain problem in Flashlight, it just failed when I debug in browser. You can close this issue.
BTW, I created a repo listing Chinese plugins for Flashlight (https://github.com/allenhsu/FlashlightPlugins). Do you have any plan to implement kinda subscription channel so that Chinese users can subscribe to a Chinese plugin list.
from flashlight.
I'm sure there's some setting in some browser that'll let you turn off
cross-domain protection during debugging.
Re: Chinese plugins:
That's awesome. At the very least, we could add some way to subscribe to
third-party repositories, but there's gotta be a better way. Maybe I'll add
some sort of channel system and then automatically enable the Chinese
channel for users w/ Chinese as their system language.
(Isn't github blocked in mainland China? Would it make sense to host this
stuff on gitcafe or something?)
On Mon, Nov 17, 2014 at 1:13 AM Allen Hsu [email protected] wrote:
Thanks @nate-parrott https://github.com/nate-parrott , I succeeded
running network requests in JS. As you said, there's no cross domain
problem in Flashlight, it just failed when I debug in browser. You can
close this issue.BTW, I created a repo listing Chinese plugins for Flashlight (
https://github.com/allenhsu/FlashlightPlugins). Do you have any plan to
implement kinda subscription channel so that Chinese users can subscribe to
a Chinese plugin list.—
Reply to this email directly or view it on GitHub
#59 (comment)
.
from flashlight.
@nate-parrott aha, github was blocked only for a few days long time ago. It works fine now.
from flashlight.
Related Issues (20)
- Flashlight does not work in El Captitan HOT 2
- Would like to see it working for EI Capitan HOT 5
- First time install - doesn't work HOT 2
- First time user/install, giving me error HOT 1
- Instranslator returns blank
- "hide hidden files" nonfunctional
- "Remind Me" plugin crashes Flashlight occasionally HOT 1
- it does not workd in OSX sierra HOT 7
- direct-to-PostgreSQL plugin?
- Feature: switch to existing Chrome tab search plugin
- @date doesn't return intended date HOT 1
- Move Flashlight to an org so maintainenance can continue? HOT 2
- Do not work in High Sierra HOT 5
- Google translate plugin doesn't work properly
- no https on http://flashlight.nateparrott.com
- Spotlight is not working on MacOs Mojave HOT 13
- Modifications in examples.txt don't take effect? HOT 1
- Crashes HOT 2
- Stop posing issues here HOT 1
- Turn a flashlight on
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flashlight.