泷涯

Results 88 comments of 泷涯

> Hello, I have reproduced the bug in codesandbox. This is the link: https://codesandbox.io/s/admiring-flower-8gdqc?file=/src/App.js. > > All you have to do is write in the editor, and the editor will...

> @sylingd Hello sorry I did forget to save, it should work now! If you change the `value` prop, the editor can not detect where the cursor should move to,...

What system and browser you are using?

> > 有没有演示的贴子?我试一下客户端API > > 这类贴子是发帖/回帖/回复楼中楼后仅自己可见的,所以只能通过自己发一些比较敏感的贴子来检查 > > 检查贴子是否被屏蔽,可以发帖后确认这个贴子正常发出没有进贴吧回收站,然后用另一个帐号或者在浏览器的隐身模式下查看对应楼层是否还能看到 我贴吧号已经被封了……试不了……

解释一下原因:重定向相关功能,包括自定义函数,运行于background page,你可以把它视为一个类似ServiceWorker的存在。 它没有完整的DOM能力(目前有,但本身与浏览器的“窗口”不在一个地方,且未来会移除),自然是无法“检测”窗口大小的。 所以,这也解释了你一开始用媒体查询为什么不起作用,因为它们根本不在一个地方运行。你“查询”出来的是一个运行在后台的window大小——实际我也不知道,它到底有多高、多宽。 ------ 楼上给的建议是结合content-script进行,这是一种可行的方式,因为content-script实际运行于网页中。另一个思路是,通过browser.tabs相关API来获取具体的窗口。但这两种方式,仅仅通过HE是无法实现的。 1. 第一种方式,需要增加content-script,而HE基于background运行,本身没有该功能。 2. 第二种方式,为了能在合适的时机获取大小,你还需要增加一些额外的事件监听。这在HE的自定义函数中是不可取的做法。 综合而言,如果你真有相关诉求,考虑单独写一个插件进行。

I will merge this PR and release a new version later. But I didn't test it, so there may be some bugs.

> > I will merge this PR and release a new version later. But I didn't test it, so there may be some bugs. > > When will this get...