1. The requirement is to enter a URL, and the front-end can get the main background color of the corresponding URL
2. No matter how I look at the front-end, I can’t meet this requirement
3. Ask for some ideas
天蓬老师2017-05-19 10:37:50
The title of the question should be that you can dynamically enter the URL to get it. You can do it with node. The main thing is to load your html first, and thenwindow.getComputedStyle(document.body).backgroundColor
巴扎黑2017-05-19 10:37:50
window.getComputedStyle(document.body)['background-color']
For methods like this, it mainly depends on what element the background color is on.
巴扎黑2017-05-19 10:37:50
For web pages, it should be possible to use an iframe with a width and height of 0 to introduce the target page, and then obtain the dom elements in the iframe