MozillaZine

injection script syntax for extension builder in Safari

Talk about add-ons and extension development.
Persay69
 
Posts: 1
Joined: April 20th, 2017, 3:03 pm

Post Posted April 20th, 2017, 3:17 pm

I perfectly understand that this is a Mozilla forum but I'd like to ask for advice anyway.

I need help in using Safari Extension Builder (on MacAir, OS EX El Capitan version 10.11.6; Safari version 9.1.2)

The task is the following: I want to visualise a certain page content - it is in fact an clickable add (URL for embedding available, looks e.g., like that

<div class="quizz-container" data-width="100%" data-iframe-title="BLABLABLA" data-height="auto" data-quiz="BLABLA"></div>
<script src="//dcc4iyjchzom0.cloudfront.net/widget/loader.js" async></script>

every time when given web pages open in the my Safari browser on my Mac.

When one opens certain web pages, in their corners usually appear (usually undesirable) publicity, advertisements, etc.

I want my injected page content to appear spontaneously and well visibly in a corner of some (previously selected) web pages. This task concerns my own Mac only.

It seems that the extension builder available in Safari (under the menu "Develop") does exactly that. There you can select which webpages to be affected by the injection, if the injected script is a start or end script, etc.

I tried to tune the extension builder according to the description. Options of the extension builder seem fairly transparent and simple, but I cannot be sure if I have selected the right options (presently, injection does not work at all, so I do not know).

Where I certainly fail is with the so-called injection script which the "builder" uses. The injection script is a Javascript file NAME.js that, between other things, should contain the embedding (URL?) of the desired content to be injected in the browser windows (when the pre-selected web-pages are open).

Could you help, possibly giving me examples of the right injection script? And also reviewing (I can send the list of options I use) the options I choose from the Extension Builder menu, so that the above task is fulfilled?

I believe it should be a really simple problem for a programmer in Java who knows the basic workings of the Extension builder in the above mentioned Safari version. Unfortunately, I do not understand Java, so I cannot do it myself.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 3 guests