Comments (5)
Wouldn't exactly say sometimes. Every single current release of every major browser supports the API. Also, if by "add those" you mean save references to the methods and put them on a new URL object, that is not going to work either, as URL is also used as a native function for URL parsing. (new URL(url_here).origin
etc.)
Simply put, URL is a global variable that should not ever be redefined unless you're polyfilling it, as I do in Blob.js. Whatever Polymer needs it for, it can use a differently named global variable if it's not using it for the sole purpose of polyfilling it.
from url.
You are right, all browsers we care about have URL.createObjectURL
and URL.revokeObjectURL
.
We already feature detect and keep the original URL if it can be new'ed.
The PR makes sure that we add the statics if the builtin is not newable.
from url.
Oh, so Polymer uses URL for it's URL processing abilities. Do you realize that document.createElement("a").href = url
is an equivalent superset of new URL(url)
?
See my new URL(...)
polyfill for more information. You will notice that origin
is manually handled, as some very old browsers don't support that natively.
from url.
@eligrey That is mostly correct. There are some issues with it. And it is also slower, since it needs a new document and uses <base>
. I took the <a>
approach in arv/DOM-URL-Polyfill but we decided to go down the current route and base this on the reference implementation of the spec.
from url.
Ah, thanks for linking me to that. I wasn't aware of that polyfill, mostly as mine focuses on the blob aspects.
from url.
Related Issues (12)
- Plans to add license and package metadata? HOT 8
- username and password is missing when provided in base, but not in input HOT 1
- Make webcomponents the network root HOT 2
- publish to npm ? HOT 4
- Add import file to the repository HOT 1
- Is this the place to go for the url-polyfill? HOT 1
- is there minified version of this lib available?
- Can't install fauxton because of this dependency HOT 2
- @webcomponents/url polyfill is broken for `new URL(undefined, "https://example.com")`
- Add searchParams and URLSearchParams constructor HOT 5
- The `origin` property does not seem to be supported. HOT 2
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 url.