safari-extension

Can you detect when a Safari popover closes?

可紊 提交于 2019-12-30 10:59:23
问题 We're trying to have multiple popovers in our extension and we need to know when the popover closes so we can change the popover value on the button. Is there any listener for that? 回答1: When the popover is closed, the window object receives a blur event. So, something like this in the popover will work: window.onblur = function () { // do stuff when popover is closed }; 来源: https://stackoverflow.com/questions/18860101/can-you-detect-when-a-safari-popover-closes

Api to get list of extensions installed in browser

淺唱寂寞╮ 提交于 2019-12-25 14:00:51
问题 I am developing an extension for chrome and safari.One step in this app is to get all the already installed extensions.Is there any safari or chrome api that can give the list of installed extensions? In safari installed extensions are stored in ~/Library/Safari/Extensions/Extensions.plist but i am not able to find any related api. 回答1: For Chrome: From within a Chrome Extension, you can use chrome.management.getAll to obtain a list of the installed extensions and apps. For Safari: There is

Safari Extension - How to respond to Settings changes?

妖精的绣舞 提交于 2019-12-24 18:10:47
问题 I'm currently working on an Extension for Safari 5 and I want to run a listener function whenever Settings changes are made. Apple provides an example for that, but it doesn't work for me. I currently have this listener function in my global html file: function numberChanged() { if(event.key == "number") alert("Number has changed!"); } safari.self.addEventListener("change", numberChanged, false); I hope somebody can help me. Does somebody know what I'm doing wrong? 回答1: I believe that you

Approaches of detection of custom protocol in chrome and Safari browsers

一世执手 提交于 2019-12-24 16:06:11
问题 What could be the best way the detecting the custom protocol (like foo://) in Safari and chrome browser. I was looking at the following options: Browser extension which can check the existence of custom protocol invoker software. (Not sure if it is possible and how to do it) Browser plugin or java applets( since NPAPI is now going to deprecated so probably this will not be good idea). Flash Action script with java script(since Flash is sand boxed then again it seems not good idea to use it)

How to use Selenium Safari Webdriver

百般思念 提交于 2019-12-22 18:22:11
问题 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 回答1: Using Python 2.7.5 and python module selenium (2.41.0). This example opens a Safari browser and does my bidding: # -*- coding: utf-8 -*- print ''' Python Selenium Safari Example ''' from selenium import webdriver from selenium.webdriver.common.keys import Keys import os # path to selenium server

How to reload a Safari Extension from the command line?

两盒软妹~` 提交于 2019-12-22 09:17:19
问题 I need to "Reload" a Safari extension from the command line (and also build the package later). How can this be done? Why? I'd like to build in one step - my code is in CoffeeScript and thus I'm compiling it anyway. What have I tried? Apart from googling hopelessly I tried using this AppleScript: tell application "System Events" tell process "Safari" click the button "Reload" of window "Extension Builder" end tell end tell Which errors out with: System Events got an error: Can’t get button

How to open popover with keyboard shortcut? [duplicate]

为君一笑 提交于 2019-12-21 20:17:07
问题 This question already has answers here : Closed 7 years ago . 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. 回答1: Abody97's answer tells you how to determine if a certain key combo has been pressed. If you're not sure how to get that key combo to show the popover, this is what you need. Unfortunately, Safari makes this needlessly

Unable to run tests on Safari - Do we need dev certificate

冷暖自知 提交于 2019-12-21 19:56:47
问题 I am trying to run my protractor tests on Safari. While researching, I learnt that you need not download anything in specific for Safari when using protractor because the driver comes with it. When attempting to run my tests I was getting "No Safari driver" found message. Then I installed this extension for Safari - from the link below. https://code.google.com/p/selenium/wiki/SafariDriver http://selenium-release.storage.googleapis.com/index.html?path=2.45/ This extension does show up on

Safari doesn't detect my Extension Certificate

落爺英雄遲暮 提交于 2019-12-21 04:51:07
问题 I have registered for the Safari Development Program and have a valid Apple ID. I've followed all the steps given by Apple. The problem is that Windows XP (Service Pack 2) does not recognize the command 'certreq', whereas the instructions said it would work on any Windows machine. However, the command 'certreq' was working on Windows Vista on the machine of my co-worker's, I downloaded the certificate (the .cer file) and installed it and Safari detected it. However, I don't have Windows Vista

How to store objects in a array using javascript

纵饮孤独 提交于 2019-12-20 04:55:09
问题 i am developing extesnions for safari browswer. i want to store current active tab objects in a array as key. how to store multiple tab objects in a array. i wrote following code. **First scenario: var obj = {}; obj1=new Object(); obj2=new Object(); obj3=new Object(); obj['cTab_'+obj1] = "This is object1"; obj['cTab_'+obj2] = "This is object2"; obj['cTab_'+obj3] = "This is object3";** prblem is i am getting 3rd object value. how to get all the object values. **Second scenario: var arr = new