MCPcopy
hub / github.com/philc/vimium / hide

Method hide

content_scripts/ui_component.js:180–206  ·  view source on GitHub ↗
(shouldRefocusOriginalFrame)

Source from the content-addressed store, hash-verified

178 }
179
180 async hide(shouldRefocusOriginalFrame) {
181 if (shouldRefocusOriginalFrame == null) shouldRefocusOriginalFrame = true;
182
183 await this.iframePort;
184 if (!this.showing) return;
185 this.showing = false;
186 this.setIframeVisible(false);
187 if (this.focusOptions.focus) {
188 this.iframeElement.blur();
189 if (shouldRefocusOriginalFrame) {
190 if (this.focusOptions.sourceFrameId != null) {
191 chrome.runtime.sendMessage({
192 handler: "sendMessageToFrames",
193 frameId: this.focusOptions.sourceFrameId,
194 message: {
195 handler: "focusFrame",
196 forceFocusThisFrame: true,
197 },
198 });
199 } else {
200 Utils.nextTick(() => globalThis.focus());
201 }
202 }
203 }
204 this.focusOptions = {};
205 this.postMessage({ name: "hidden" }); // Inform the UI component that it is hidden.
206 }
207}
208
209globalThis.UIComponent = UIComponent;

Callers 8

loadMethod · 0.95
initMethod · 0.45
checkIfEnabledForUrlFunction · 0.45
abortFunction · 0.45
toggleFunction · 0.45
abandonFunction · 0.45
showFunction · 0.45
hideFunction · 0.45

Calls 2

setIframeVisibleMethod · 0.95
postMessageMethod · 0.95

Tested by

no test coverage detected