Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Add firefoxOs suport for xhr #7514

Closed
wants to merge 2 commits into from
Closed

Add firefoxOs suport for xhr #7514

wants to merge 2 commits into from

Conversation

bedabliu
Copy link

Add a function to detect if is FirefoxOS system, then if it´s true it add the attribute mozSystem: true that is needed for firefox os apps to work.

Add a function to detect if is FirefoxOS system, then if it´s true it add the attribute mozSystem: true that is needed for firefox os apps to work.
@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#7514)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

Add a function to detect if is FirefoxOS system, then if it´s true it add the attribute mozSystem: true that is needed for firefox os apps to work.
@bedabliu
Copy link
Author

this refers to issue #2318

@IgorMinar
Copy link
Contributor

We can't enable this by default, the option is in FirefoxOS for a reason (security).

Instead we should make it possible to define an object who's properties should be copied to the XHR object, once created.

@IgorMinar
Copy link
Contributor

so you could use it as $http.get('/foo', { xhrFields: { mozSystem:true }});

if you'd like to implement this, please open a new PR.

thanks!

@caitp
Copy link
Contributor

caitp commented May 19, 2014

Instead we should make it possible to define an object who's properties should be copied to the XHR object, once created.

We already do this for a number of properties in the config object, it would be trivial to just make a whitelist of allowed properties to copy in if present, and a bit nicer than adding a new object property to the config, IMO.

@IgorMinar
Copy link
Contributor

then we need to maintain the whitelist and people will want to add stuff into the list of every possible platform out there.

another option is to whitelist our properties and copy everything else.

@caitp
Copy link
Contributor

caitp commented May 19, 2014

then we need to maintain the whitelist and people will want to add stuff into the list of every possible platform out there.

What if it were just configurable via httpProvider, similar to sce whitelists?

@bedabliu
Copy link
Author

It´ll be nicer if we can make it configurable, because it´s a pattern in firefox os, to do a XHR you need to add this feature always, if we can use it as a config it´ll be a lot easier for the firefox os app developers.

@caitp
Copy link
Contributor

caitp commented May 19, 2014

Or, to take a line from Ember/Rails playbooks, go with "convention over configuration" and supply a default set of properties for "mainstream" platforms, while still enabling people to work around them if they need to

@IgorMinar
Copy link
Contributor

The definition of mainstream changes over time but removing special cases is then not trivial. So I'd rather avoid that as much as possible.

The solution I proposed earlier would work with providers as well. In this case the config block would change the defaults exposed on the provider and set the property.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants