Closed
Bug 1339000
Opened 8 years ago
Closed 3 years ago
Some content is not shown on qq.com, due to use of event.srcElement
Categories
(Web Compatibility :: Site Reports, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: etsai, Unassigned)
References
()
Details
(Keywords: site-compat, webcompat:site-wait, Whiteboard: [sitewait][zh-CN])
Attachments
(5 files, 1 obsolete file)
Steps to reproduce:
1. Open URL: http://info.3g.qq.com/g/s?aid=index&from=wap3g&s_it=1&sid=00
2. Scroll down to "娱乐"(entertainment)
Expected behavior: Category icons are loaded (see attachment), like 明星(star), 日韩(Japan/Korea), etc. News thumbnail are loaded (see attachment). News source are shown, like 视觉中国, 騰讯音乐(Tencent Music)。
Actual behavior: Category icons, news thumbnail and news source are not loaded.
There are lots repeat error message in web console.
> TypeError: e is undefined[Learn More]
> inc-core_v2_2.js%20line%201%20%3E%20eval:1:151990
Reporter | ||
Comment 1•8 years ago
|
||
It's also possible to reproduce this issue from Firefox mobile 51~54, Firefox 54 in responsive mode with Firefox mobile 54 UA string.
Whiteboard: [needsdiagnosis][zh-CN]
Comment 2•8 years ago
|
||
(I would guess that "e is undefined" is a window.event bug...)
Comment 3•8 years ago
|
||
It might be a Geo restriction, but the content I see from the link is different (see screenshot from texas). I also don't see the error.
Eric, could you take a look at the error in the stack to provide more context?
Flags: needinfo?(etsai)
Reporter | ||
Comment 4•8 years ago
|
||
Today I see the error message, it's interesting:
> TypeError: e is undefined[Learn More]
> inc-core_v2_2.js%20line%20545%20%3E%20eval:1:151990
So I see inc-core_v2.2.js line 545, function run wants to eval a script: (already beautified)
> function run(url) {
> if (url && /\S/.test(url)) {
> (window.execScript || function(idx) {
> window["eval"].call(window, idx);
> })(url);
> }
> }
So what's in url, it's in function, get from local storage:
> var url = null;
> try {
> url = localStorage.getItem(key);
> cDigit = localStorage.getItem(key + "?ver") || "999";
> } catch (b) {
> callback(element, str, selector, done);
> return true;
> }
Here, key is //infocdn.3g.qq.com/g/storeinc/infocdn/wap30/info_app/index6/base.js and value is long script, I save as attachment.
In base.js:151990, it's
> var r = o[a];
in function s(t,e), I wonder it's where throw exception or not, doesn't look like use e but undefined:
> function s(t, e) {
> if (!g[t]) {
> g[t] = !0;
> var i = {
> project_id: p,
> department_id: h,
> hijack_type: t,
> page_url: location.href,
> blocked: 1
> };
> if (e && (i.ad_url = e.join("||")), 1 == t && f) {
> for (var n = document.head.outerHTML, o = document.body.children, a = 0; a < o.length; a++) {
> var r = o[a];
> "IFRAME" == r.nodeName.toUpperCase() && r.src && 0 != r.src.indexOf("http") || (n += r.outerHTML)
> }
> n = n.replace(/<script[^>]*>[\s\S]*?<\/script>/gi, ""), n = n.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, ""), i.html_dom = n
> }
> setTimeout(function() {
> l(i)
> }, 500)
> }
> }
Flags: needinfo?(etsai)
Reporter | ||
Comment 5•8 years ago
|
||
Use this to see the script cause "e is undefined"
Reporter | ||
Comment 6•8 years ago
|
||
Mike, if you want to reproduce, you can click the line in red rectangle to switch to touch screen version instead stay in simplified version. I get this version once with older Fennec UA, maybe you can try.
Comment 7•8 years ago
|
||
Using mitmproxy, I managed to alter the function Eric hunted down and have it store the 260k long function string into a global variable, which I could then `copy()` in the devtools. Then I hacked the function to not bother loading that key from localStorage, and instead just dumped an unminified copy of it to end of that same script (my local copy for mitmproxy, of course). From there, I was able to track down the issue.
That localStoraged script defines a module named Swipe. The problem is this line in the function o in that Swipe module:
>var e = t ? t.srcElement : document.documentElement;
Firefox has no support for srcElement (yet? See bug 453968), so that's where the undefined value is coming from. They could instead use something like the following (which still includes srcElement for very old IE versions, if they still need to support them):
>var e = (t && (t.srcElement || t.target)) || document.documentElement;
But I can't be 100% sure if that's enough to fix the problem overall, as I can only test the version of the page that you suggested to Mike in comment 6.
As such, I've attached my altered copy of `http://3gimg.qq.com/wap30/info/inc-core_v2_2.js` (with the hack to not load the script from localStorage, instead having it appended right in the script itself, with my proposed fix already made).
Eric, could you confirm if it works for you on the reported link?
Flags: needinfo?(etsai)
Comment 8•8 years ago
|
||
Oops, I attached the wrong script. Here's the right one.
Attachment #8841686 -
Attachment is obsolete: true
Comment 9•8 years ago
|
||
Thanks Tom! We can try outreach, but srcElement is something we want to get implemented in Gecko (I'm working on the spec stuff ATM).
Updated•8 years ago
|
Summary: Some content is not shown on qq.com → Some content is not shown on qq.com, due to use of event.srcElement
Reporter | ||
Comment 10•8 years ago
|
||
Bingqing, as Thomas' comment 7, do we have contact in qq.com?
Flags: needinfo?(etsai) → needinfo?(bli)
Comment 11•8 years ago
|
||
(In reply to Eric Tsai from comment #10)
> Bingqing, as Thomas' comment 7, do we have contact in qq.com?
We've started to contact tencent, and I'll give an update if there is any progress.
Flags: needinfo?(bli)
Updated•8 years ago
|
Whiteboard: [needsdiagnosis][zh-CN] → [sitewait][zh-CN]
Updated•7 years ago
|
Priority: -- → P3
Comment 12•6 years ago
|
||
Updated the site compatibility note: https://www.fxsitecompat.com/en-CA/docs/2018/support-for-event-prototype-srcelement-has-been-added/
Keywords: site-compat
Assignee | ||
Updated•6 years ago
|
Product: Tech Evangelism → Web Compatibility
Comment 13•5 years ago
|
||
See bug 1547409. Moving webcompat whiteboard tags to keywords.
Keywords: webcompat:site-wait
Comment 14•3 years ago
•
|
||
I was not able to reproduce the issue. The category icons are loading as expected:
Bingqing, can you confirm please?
Tested with:
Browser / Version: Firefox Nightly 100.0a1 (2015870107 -🦎100.0a1-20220321065848🦎)
Operating System: Google Pixel 3 (Android 12) -1080 x 2160 pixels, 18:9 ratio (~443 ppi density)
Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(bli)
Resolution: --- → FIXED
Comment 15•3 years ago
|
||
(In reply to raul softvision from comment #14)
I was not able to reproduce the issue. The category icons are loading as expected:
Bingqing, can you confirm please?
I cannot reproduce the issue either. The website is different now and everything looks fine now.
Thanks for your time.
Tested with:
Firefox release version V98.2.0
Firefox Nightly 100.0a1 build #2015870379
Flags: needinfo?(bli)
Assignee | ||
Updated•7 months ago
|
Component: Mobile → Site Reports
You need to log in
before you can comment on or make changes to this bug.
Description
•