Are these 2 capabilities supported in Safari extension development? -


I wrote a Chrome / Opera extension and I'm considering porting it to Safari It requires 2 special abilities and in the absence of this, either the whole plan will have to veto

  1. Ability to read HTTPS URL - Chrome "Tab" It supports this as part of the permit. Firefox (the last time I checked).

  2. The ability to dynamically change the appearance of the activation button. - In Chrome, this is achieved by having a single canvas (i.e. buttons) on the background page ...

    ---- -canvas id = "button_canvas" width = "19 "Height =" 19 "- - / canvas - / / body -

... and then dynamically required when changing it ...

  var canvas = document.getElementById ("button_canvas"); Var Context = Canvas Gate Contact ("2D"); Var image data = context.getImageData (0, 0, 19, 19); // Write the luggage in the canvas context. Input image data (image data, 0, 0); ImageData = context.getImageData (0, 0, 19, 19); // key element below Chrome Broser Action .set icon ({imageData: imageData});  

Before purchasing Mac used on Craigslist, one can definitely answer these two questions, so I appreciate it. Thanks!

PS FWW, My own Googling suggest that # 2 is not possible in Safari # 1 There is no information about # 1

I believe both are possible.

For HTTPS URL: Under Extension Website Access in Safari Extension, set Access Level to All and Click the Include Safe Page checkbox.

To dynamically change the icon displayed on a toolbar icon, first set an icon in the Safari extension builder. If you want to change in the answer to Toolbar Button, click:

  safari.application.addEventListener ('command', performCommand, false); Function Work Commands (if (event.command === 'changeIcon') {event.target.image = safari.extension.baseURI + 'OtherCon.' '; }}  

In other circumstances, you want to modify your toolbar button to modify it:

  var toolbarButtons = safari Extension.toolbarItems; (Var i = 0; i & lt; itemArray.length; ++ i) for {var item = toolbarButtons [i]; If (item identifier === "mybutton") {item.image = safari.extension.baseURI + 'oscillator' '; }}  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -