Safari add-on run shell script - javascript

I'm trying to make an add-on that takes the last hyperlink clicked in Firefox and opens it in Safari.
I'm trying with this broadly speaking:
let myLink = document.location.href
to get the last clicked URL as a string. Now I would like to pass it as an argument to this shell script:
>>> myScript.sh $myLink
open -a Safari "$1"
I can't make it work.
The master plan behind this is to use this add-on to open YouTube links from Firefox in Safari (where I'm logged in with my YouTube Premium account). I know in macOS I could just drag the link to the Safari icon in the dock...

Related

Is it possible to open a new URL in Safari from Chrome if the page is being viewed on an iOS device?

Let’s say I have a webpage and it has a button with an HREF attribute. I want the HREF of that button to be opened on Safari browser if the button is being clicked from an iOS device, even if the user is accessing the page on Google Chrome.
As of now, I only need to handle this situation for Chrome and not any generic browser. The way I see it, there are two parts to the problem:
Identifying the OS of the Client Machine: This I might be able to do easily.
Opening the Popup on Safari from Chrome: This is the tricky part I am not sure if it is possible.
I am looking for possibilities of accomplishing the second part.
Short Answer: no.
Long Answer: Some iOS apps have defined URL schemes that can be used to access the app directly from the browser. For example, twitter://timeline. But Safari for iOS does not have one.
You can detect the OS the user is using and if it Chrome then suggest the user to open it in Safari and also provide the link where to download it from. Or you can also suggest the user to make safari their default browser. ( Also provide a link on how to do that to them).

getURL("javascript:window.close();") not working in current web browser like firefox mozilla and google chrome

I am using as2 flash cs5. I have made many games and added getURL("javascript:window.close();") to exit window. it works in enternet explorer but not working now on google chrome and firefox mozilla.
when i press the button it says :
Scripts may not close windows that were not opened by script.
please help
You can only do this in firefox by adding following preferences into about:config area.
dom.allow_scripts_to_close_windows
setting this to true would allow you to close apps with script.

Window.print() and cloud printing

My application is developed in ASP.NET
In one of my pages(productinfo.aspx) I have a HTML button named & labelled
as print. I am handling the click of this button in java script like
below.
$('#print').click(function($)
{
window.print();
});
The above is working fine in all browsers on PC and in smartphones as well
except Google Nexus mobiles and tablets. It is working in other android
mobiles like Samsung and Sony experia etc..
I came to know that window.print is not supported in Google android and I
should use Google cloud print based on the following link.
https://developers.google.com/cloud-print/docs/gadget
But this requires the user to be logged into to GCP with their Google ID.
But my requirement is like the device will be not connected to Internet
and it should provide the print as dialog as like in other devices.
Note:
In Android chrome browsers there is a print command in the browsers menu
clicking on that is showing the print dialog without any GCP.
Is it possible to invoke the browsers menu command through java script,
I tired simulating (ctrl+p) key press event on the button click assuming
that it will trigger the browser's print command it too didn't work.
It would be very much helpful if any one can help me with a solution for
this issue.

I need to make web-app work as windows full screen app. In IE-11 (last) for PC (WIN-7), full screen mode, with a button to close it

I need to make web-app work as windows full screen app.
In Microsoft Internet Explorer - 11 (last) for PC (Windows-7), full screen mode, with a button to close it.
.
The first task is a fullscreen mode.
I can make fullscreen easily (Thanks to another question here)
window.open ("mapage.html","","fullscreen=yes");
window.open('','_parent','');
window.close();
It work perfectly but only for "localhost", once I put files to the server the 'fullscreen' appears to be not fully fullscreen, but it also shows window header with /close/ and /minimize/ buttons and the /address bar/. And it reveals IE.
.
The second task is a button to close it.
Luckily IE window may be closed with simple
window.close();
But IE asks approval and it reveals itself. I find a way to bypass it with the code from above that I use to make IE work in fullscreen. Unfortunately, I cannot use this fullscreen solution. So If there would be another, please, take to account that I would need the close button for all application.
Ok, this is what I came up with:
Option 1
Use something to run Internet Explorer in kiosk mode.
like a .bat file
"%ProgramFiles%\Internet Explorer\iexplore.exe" -k "http://google.com/"
or Delphi (to have an .exe file):
var filename, parameters: string;
begin
filename := '"iexplore.exe"';
parameters := ' -k "http://google.com/"';
ShellExecute(handle,'open',PAnsiChar(filename), PAnsiChar(parameters), nil , SW_MAXIMIZE);
end;
Option 2
Use Delphi with EmbeddedWB component.
EmbeddedWB1.Navigate('http://google.com/');
One string of code and I have my own browser with or without address panel.

window.open on Windows Phone 7

I am looking for any information, or help with an issue I am having with Mobile IE9 on Windows Phone 7 Mango; although I would settle for a resolution on Windows Phone 7 in general.
<input type="button" value="input" onclick="window.open('http://www.google.com')" />
<span onclick="window.open('http://www.google.com')">span</span>
anchor
I am using this.
http://jsfiddle.net/ag7wU/1/embedded/result/
When I select any of these elements on the Windows Phone 7.0/7.1, I navigate to google.com. On every other browser I can readily find, a new window/tab is created: Chrome, Firefox 6.0, Opera 11.50, IE9, Safari, WebKit on BB OSv6, Dolphin on Android 2.3.3, Dolphin on android 3.2, and mobile safari on the IPhone and IPad.
The only exception is windows phone 7. The best solution I can find is to use the anchor tag and href attribute, and instruct users that they are going to have to hold down the links they want, and select "open in new tab" Am I missing something?
You should always provide a fallback for environments that do not support multiple tabs and windows (or JavaScript).
You want to make sure that the browser can display a real URL when the user hovers over the link, and that the link is long-press/right-click copyable.
You also want to preserve link URLs for indexers, link checkers, offline archivers like archive.org, and other robots.
anchor

Categories