cnumr / cnumr/EcoIndex_python

[Bug]: iframe content not accounted for when calculating ecoindex

Đang mở
#34 5 bình luận 0 reaction 1 người được giao Được @vvatelot nhận Xem trên GitHub
bug keep open
Ngôn ngữ chính
Python
Star
26
Fork
10
Merge trung bình
13 giờ 31 phút
Pull request đã merge (30 ngày)
5

Mô tả

### What happened?

ecoindex_cli does not take the content of iframes into account when calculating the ecoindex of a page.

I'm using the following files as a [testcase.zip](https://github.com/cnumr/ecoindex_cli/files/10842098/testcase.zip), served locally on port 8080.
I analyze the page using the following command and get this result :
```
ecoindex-cli analyze --url http://127.0.0.1:8080/testEcoIndexIFrame.html --export-format json --outputfile ./result.json
```

result:
```
[
{
"width": 1920,
"height": 1080,
"url": "http://127.0.0.1:8080/testEcoIndexIFrame.html",
"size": 2.511,
"nodes": 6,
"requests": 3,
"grade": "A",
"score": 97.0,
"ges": 1.06,
"water": 1.59,
"ecoindex_version": "5.4.1",
"date": "2023-02-27 17:50:40.593434",
"page_type": null
}
]
```

The number of DOM nodes detected by ecoindex-cli is 6, which maps the content of the main html file, but does not include the content of the html inside the iframe.
The number of requests and the size seems to be correct though : when I increase the subPage.hml page's size, the size reported by ecoindex-cli increases as well.

On some real life pages, this can make a huge different in the final rank obtained when analyzing a page (from G to E rank).

### Version

Above 3.6

### What OS do you use?

Linux

### urls

_No response_

### Relevant log output

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.