arrive icon indicating copy to clipboard operation
arrive copied to clipboard

Detect page title change

Open TuTAH1 opened this issue 2 years ago • 5 comments

I throught that this code will execute every time when page is changing. I was fear it can trigger itself, because it executes a function that changes itself, but it didn't work at all (for example, if I just call removeCapsFromElement(document.querySelector("title")) I can see it's changing for a split second, but when I replace it by

document.arrive( "title", {fireOnAttributesModification: true}, pageName => removeCapsFromElement(pageName))

, it doesn't work at all. Where is my mistake?

TuTAH1 avatar Jun 04 '22 15:06 TuTAH1

That’s not how it works. You need to specify selector for the element which is changing.

uzairfarooq avatar Jun 05 '22 04:06 uzairfarooq

That’s not how it works. You need to specify selector for the element which is changing.

What do you mean? title is changing and I specified a selector for it

TuTAH1 avatar Jun 05 '22 12:06 TuTAH1

I see, the current version of arrive does not support support content change. So if the text of element changes, it wont trigger arrive callback.

I think i have a little modified version of arrive which does trigger callback on content change but it depends on a jQuery selector. I can share it tomorrow if you need it.

uzairfarooq avatar Jun 05 '22 16:06 uzairfarooq

I can share it tomorrow if you need it.

Yeah, it would be great, thanks

TuTAH1 avatar Jun 05 '22 19:06 TuTAH1

@uzairfarooq: any update? This restrict me from adopting your library currently as text changes are needed.

ZzZombo avatar Nov 18 '22 06:11 ZzZombo