Comments (5)
Duplicate: #182
from umatrix.
Which is a duplicate of #46, an almost four year old issue. Is it impossible to fix?
I see Raymond's comment about browser rendering the text and uMatrix not knowing it will be cut, but it seems to be possible to check the text width in pixels by using invisible DIV:
https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript
I am not sure how much that would slow the rendering though?
from umatrix.
A clean solution would be adding a title
attribute whenever the host name exceeds a certain length.
<div title="bw-1651cf0d2f737d7adeab84d339dbabd3-bwcore.s3.amazonaws.com" class="matCell ....">
<b>bw-1651cf0d2f737d7adeab84d339dbabd3-bwcore.s3.amazonaws.com</b>
</div>
from umatrix.
gorhill/httpswitchboard#133 (comment)
from umatrix.
Well it turns out that in HTML5 you can use canvas to measure text width:
function getTextWidth(text, font) {
// if given, use cached canvas for better performance
// else, create new canvas
var canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
var context = canvas.getContext("2d");
context.font = font;
var metrics = context.measureText(text);
return metrics.width;
};
...
getTextWidth("bw-1651cf0d2f737d7adeab84d339dbabd3-bwcore.s3.amazonaws.com", "bold 12pt arial");
This shouldn't slow down the popup, @gorhill what do you think Raymond?
from umatrix.
Related Issues (20)
- New issue tracker is at https://github.com/uBlockOrigin/uMatrix-issues/issues
- neuer Issue Tracker von
- Nochaeeeema_doar nn_doar nnhh_doar nnNeue
- New counter showing different results x graphic matrix HOT 2
- my rules HOT 2
- Settings sync not working properly HOT 2
- Usability issue: Position of the ruleset icon (puzzle icon) HOT 8
- How to make uMatrix use less RAM? HOT 4
- Yandex search blocked completely HOT 6
- Puzzle piece icon doesn't display tooltip HOT 1
- Site can read cookies even though they are blocked HOT 8
- Firefox version conflict before installing uMatrix HOT 2
- Click anywhere on Recipe name to apply
- Ruleset pane size miscalculated HOT 3
- uMatrix uses the false domain 1.wyciwyg-scheme instead of the real one HOT 3
- No Login at binance.com puzzle
- Umatrix Broken, Had to remove / reinstall; Thankfully I had backed up my rules a few days before HOT 2
- Cannot UPDATE Assets HOT 13
- Youtube trouble when watching videos... HOT 1
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 umatrix.