Questions tagged [safari-extension]

A legacy API to extend Apple's Safari web browser. As of Safari 14/MacOS 11, a framework named Safari Web Extension implements the standard browser extension APIs. Safari App Extensions, introduced with MacOS 10.12 ("Sierra"), is aimed at integration of native applications with the browser.

Safari Extensions is the term Apple used for a legacy API to extend the browser. As of MacOS 11, Safari Web Extensions (safari-web-extension) is the official framework to implement browser extensions in JS, while Safari App Extensions (safari-app-extension) focus on the integration of native applications with the browser and their communication.

Legacy documentation can be found starting at the Safari Extensions Development Guide.

662 questions
4
votes
0 answers

Safari Extension Development - Auto Reload / Inspect Global Page

I'm developing a Safari Plugin. I'd like to add the following workflow to my task runner (Grunt): Bring up the Extension Builder Uninstall my plugin (Possibly restart Safari) * Re-Add my plugin Install my plugin Inspect the global page Load a test…
Jeff
  • 458
  • 6
  • 12
4
votes
2 answers

How to use Selenium Safari Webdriver

I'm trying to use Safari WebDriver, and I followed the instructions here to build a Safari Driver, but now I don't know how to import it and use it in my code. I'm using python on Mac OSX
AboulEinein
  • 1,101
  • 3
  • 13
  • 27
4
votes
2 answers

Dispatch messages from a safari extension popover to the global page

I have a safari extension popover that needs to communicate with its global page. From a content-script I am using safari.self.tab.dispatchMessage(name,data); to accomplish that. From a popover I didn't find a way to do that. I know that I can…
Stan Wiechers
  • 1,962
  • 27
  • 45
4
votes
4 answers

Using Selenium Webdriver and Safari

I am working on Selenium Webdriver C# using Visual Studio Express 2012. I installed the latest safari browser and I create the developer certificate for extension from Apple and I built the extension and install it. But even after that, I am not…
Mega Lestari
  • 41
  • 1
  • 2
4
votes
3 answers

How to open popover with keyboard shortcut?

Possible Duplicate: Keyboard shortcuts with jQuery I want to display a popover window using a shortcut key instead of clicking the icon on the toolbar. Do you have any good idea? Thank you for your help.
4
votes
2 answers

One Click install for Safari Extensions

When a user downloads a plugin firefox (for example) the plugin installation begins as soon as the download has completed. Is it possible to achieve the same thing in safari? i.e. user clicks link to download plugin, once it has downloaded it…
opsb
  • 29,325
  • 19
  • 89
  • 99
4
votes
1 answer

Selenium RC with safari issues - Selenium::WebDriver::Error::UnknownError: Executor has not been started yet

I am trying to open safari using Selenium RC. However, Safari instance is created and stays in Requesting connection mode (SafariDriver requesting connection at ws://localhost:3078/wd). require "selenium-webdriver" caps =…
Cthulhu
  • 274
  • 1
  • 2
  • 9
4
votes
2 answers

making safari extension in context menu. When over image mouse right click, how i know image url?

Making safari extension imageSearch By google. Here is my source. injected.js document.addEventListener("contextmenu", handleContextMenu, false); function handleContextMenu(event) { safari.self.tab.setContextMenuEventUserInfo(event,…
dm6637
  • 43
  • 4
4
votes
3 answers

Javascript code to detect if focus is in a text field

I'm trying to make a safari extension that does something if the cursor focus isn't in a text field. However the following code to detect if the focus isn't in a text field does not work. if ($(document.activeElement).attr("type") != "text" …
thisiscrazy4
  • 1,905
  • 8
  • 35
  • 58
4
votes
1 answer

Access Settings in Start Script of Safari Extension

I'm working on a Safari extension now, but I haven't been able to find a way to access any of the extension's settings from within the start script. I can access them just fine from the end script by getting them from messages to the global.html…
Sunookitsune
  • 327
  • 1
  • 2
  • 9
4
votes
1 answer

Set New tab/window URL in Safari Extension

I am creating a safari extension. how do I manually set the new tab/window to a URL of my choosing? I used some of logic from this post to make sure I am only taking over user created tabs/windows Safari extension: Event for a completely new tab?…
James
  • 53
  • 5
3
votes
1 answer

Safari extension injected script/webpage interaction

I am building a Safari browser extension I would like to call a function in a web page from an injected script For instance if I created a script on a page from an injected script: var newElement = document.createElement("script");…
3
votes
1 answer

how to refresh content of safari extensions popover

How can I refresh the content of a safari extensions popover, so that everything in the window is loaded over? If you're interested in relation to what, I need the content to reload everytime the tabbar icon is clicked, so that multiple tabs do not…
Jakob
  • 4,784
  • 8
  • 53
  • 79
3
votes
1 answer

Getting selected text via Safari Extension

I started learning how to program a Safari extension, and unfortunately Apple's Developer Reference pages on that are not really detailed. Hence my question: Anyone knows how I can pass the text selected by a user in a variable? My extension is a…
Anas
  • 866
  • 1
  • 13
  • 23
3
votes
2 answers

Safari Extension, accessing page/content directly from toolbar?

IS it possible to access web content directly from the (Safari) toolbar? I can now access it from a contextmenu, but no idea how i get the same functionaliy to a toolbar. This is what i got: // injected document.addEventListener("contextmenu",…
Roger
  • 7,535
  • 5
  • 41
  • 63