Comments (3)
The second way means add style
as below:
<style>
.size-sensor-object {
// ...
}
</style>
then use class name instead of inline style? What the meaning of a nonce attribute?
from size-sensor.
then use class name instead of inline style? What the meaning of a nonce attribute?
It is basically a way to whitelist which scripts/styles are allowed to be executed on a page to protect against certain scripting attacks.
The nonce is a random token that is generated on the server new for every page visit.
Look for example here for a detailed explanation: https://stackoverflow.com/a/42924000
We would need a way to "inject" our nonce attribute from the document into the <style>
tag that size-sensor
generates. Not sure what is best practice here for other libraries, but I quite like JSS's approach, they read the value from the document
's <meta>
tag.
from size-sensor.
@tzimmermann can give me a pr for this? I would like to see whether it will increase the complexity of usage.
from size-sensor.
Related Issues (10)
- ResizeObserver 对象复用 HOT 3
- 使用echarts-for-react中遇到一个问题,echarts-for-react 监听事件就是使用size-sensor, IE 11 下无法触发监听resize事件 HOT 5
- edge,ie浏览器在这种情况下,宽度改变,不会触发,高度改变会触发 HOT 1
- Size-sensor not responding to width changes in Safari (desktop) HOT 5
- unbind 之后,没有删除 size-sensor-id 属性 HOT 1
- 只调用 unbind 不调用 clear 的话存在内存泄漏 HOT 1
- [Bug] Focus is captured by the sensor object HOT 1
- 第一次默认触发 HOT 3
- 使用echarts-for-react中遇到一个问题(涉及到size-sensor) HOT 4
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 size-sensor.