safari-extension

Safari App Extension not installed

徘徊边缘 提交于 2019-12-01 09:11:00
问题 FYI I'm totally new to XCode development. I have a Safari App Extension project. If I run it from within XCode, it adds my extension to Safari just fine. If I create an Archive, Export, and choose "Export a Development Signed Application" I can take the generated file, install it on another computer, run Safari, and see the extension. If I create an Archive, Xport, and choose "Save for Mac App Store Deployment" and then install the generated file, I see my App Extension in my Applications,

Safari extension: Event for a completely new tab?

允我心安 提交于 2019-12-01 00:07:08
I'm looking to redirect new tabs in Safari to a certain URL, in essence changing the default new tab page. However, I do not want to redirect new tabs that are opened by following links. The Windows and Tabs API describes tab "open" events, but these are fired when any new tab opens (including new tabs opened from links). Is there a way to catch a new tab event for only those tabs that are created by clicking the new tab button? Thanks in advance! In your open event handler, first check if the event target is a tab. If it is, register an event handler for the beforeNavigate event on that tab.

Safari extension: Event for a completely new tab?

有些话、适合烂在心里 提交于 2019-11-30 18:39:57
问题 I'm looking to redirect new tabs in Safari to a certain URL, in essence changing the default new tab page. However, I do not want to redirect new tabs that are opened by following links. The Windows and Tabs API describes tab "open" events, but these are fired when any new tab opens (including new tabs opened from links). Is there a way to catch a new tab event for only those tabs that are created by clicking the new tab button? Thanks in advance! 回答1: In your open event handler, first check

Convert Google Chrome Extension to Firefox or Safari extension

别等时光非礼了梦想. 提交于 2019-11-30 12:51:04
问题 Is it possible to convert a Google Chrome extension to a Firefox or Safari browser extension? 回答1: Both Chrome and Firefox add-ons are essentially based on a JavaScript core, but Firefox is, by design, much more extensible. The Gecko engine and XUL (Mozilla's XML User Interface Language) allow for a much larger degree of freedom in what you can do with your extension, while Chrome (and WebKit) try to sandbox the working of its 'apps'. So, yes, a Chrome extension can almost definitely be made

How can I build a Safari extension package from the command line?

半城伤御伤魂 提交于 2019-11-30 10:39:51
问题 Instead of going to Extension Builder > Build Package… , I'd like to built a .safariextz package from the MyExtension.safariextension folder. I know I can unpack an extension with xar -xf . I suspect the way back involves packing it with xar , but then I'll need to do the code signing thing, which may or may not involve codesign(1). 回答1: Here are Omar Ismail's instructions, omitting the need for separate shell scripts. This will all occur in a directory safari/ , where we will be signing the

How to open Safari Extension ToolbarItem popover programmatically

蓝咒 提交于 2019-11-30 08:31:31
问题 I want to programmatically trigger a 'click' event on my Safari Extension toolbarItem so that my custom popover appears after something happens on the webpage. I'm using the new Xcode extension IDE and have built my popover using interface builder. All of the answers on StackOverflow currently deal with extensions built in the Safari extension builder and not in the Xcode interface. For example, I have tried injected Safari JS solutions like: safari.extension.toolbarItems[0].showPopover();

How can I build a Safari extension package from the command line?

此生再无相见时 提交于 2019-11-29 21:47:30
Instead of going to Extension Builder > Build Package… , I'd like to built a .safariextz package from the MyExtension.safariextension folder. I know I can unpack an extension with xar -xf . I suspect the way back involves packing it with xar , but then I'll need to do the code signing thing, which may or may not involve codesign(1) . Here are Omar Ismail's instructions, omitting the need for separate shell scripts. This will all occur in a directory safari/ , where we will be signing the directory safari/appname.safariextension/ to become the extension safari/appname.safariextz . The first

How to open Safari Extension ToolbarItem popover programmatically

白昼怎懂夜的黑 提交于 2019-11-29 07:06:07
I want to programmatically trigger a 'click' event on my Safari Extension toolbarItem so that my custom popover appears after something happens on the webpage. I'm using the new Xcode extension IDE and have built my popover using interface builder. All of the answers on StackOverflow currently deal with extensions built in the Safari extension builder and not in the Xcode interface. For example, I have tried injected Safari JS solutions like: safari.extension.toolbarItems[0].showPopover(); But nothing happens, and I don't think it's supposed to work when you build extensions in Xcode. I don't

Highlight URL bar using Chrome and Safari extension

心不动则不痛 提交于 2019-11-28 13:46:08
Is it possible to highlight the URL bar (set focus to the location bar) using Google Chrome extensions or Safari extensions? Using Firefox extensions, one can highlight the URL bar like this: var addressBar=document.getElementById('urlbar'); addressBar.focus(); addressBar.select(); I'm not sure if there's similar functionality in Chrome and Safari. Thanks in advance for your help! Juzer Ali Firefox, in its plugins and extensions gives access to browser's "chrome" (the UI stuff around the page) which makes this possible, although I am not sure of the api that you have mentioned. Google Chrome,

Can a site invoke a browser extension?

对着背影说爱祢 提交于 2019-11-26 14:27:25
I am a newbie to the browser extension development and I understand the concept of browser extensions altering the page and injecting codes into it. Is there a way this direction can be turned around? I write an extension that provides a set of APIs, and web sites that want to use my extension can detect its presence and if it is present, the website can call my API methods like var extension = Extenion(foo, bar) . Is this possible in Chrome, Firefox and Safari? Example: Google created a new extension called BeautifierExtension. It has a set of APIs as JS objects. User goes to reddit.com.