diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/content/presenters/FollowPresenter.ts | 6 | ||||
-rw-r--r-- | src/content/presenters/Hint.ts | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/content/presenters/FollowPresenter.ts b/src/content/presenters/FollowPresenter.ts index 8aef819..827652a 100644 --- a/src/content/presenters/FollowPresenter.ts +++ b/src/content/presenters/FollowPresenter.ts @@ -11,6 +11,7 @@ const TARGET_SELECTOR = [ '[contenteditable=""]', "[tabindex]", '[role="button"]', + "[onclick]", "summary", ].join(","); @@ -92,7 +93,10 @@ export class FollowPresenterImpl implements FollowPresenter { } createHints(viewSize: Size, framePosition: Point, tags: string[]): void { + const t0 = performance.now(); const targets = this.getTargets(viewSize, framePosition); + const t1 = performance.now(); + console.log("Took: " + (t1 - t0)); const min = Math.min(targets.length, tags.length); for (let i = 0; i < min; ++i) { const target = targets[i]; @@ -129,7 +133,7 @@ export class FollowPresenterImpl implements FollowPresenter { const filtered = Array.prototype.filter.call( all, (element: HTMLElement) => { - const style = window.getComputedStyle(element); + const style = element.style; // AREA's 'display' in Browser style is 'none' return ( diff --git a/src/content/presenters/Hint.ts b/src/content/presenters/Hint.ts index 3f39060..8bf265b 100644 --- a/src/content/presenters/Hint.ts +++ b/src/content/presenters/Hint.ts @@ -119,7 +119,10 @@ export class InputHint extends Hint { default: if (doms.isContentEditable(target)) { return target.focus(); - } else if (target.hasAttribute("tabindex")) { + } else if ( + target.hasAttribute("tabindex") || + target.hasAttribute("onclick") + ) { return target.click(); } } |