I'm looking for very specific way to open links or create shortcuts to open links with already loaded Javascript on website.
For example. I have portal to which I have link:
example.com/text/nu#action:projmgr.text&id123456 but on site there is gear icon which have to be activated and then selected Export to Excel (Data Only) which is a JavaScript link like javascript:text.text.exportToFile('npt.(...)'500','text.text').
I have like 50 lists to export by clicking on the first link and then navigate through those steps.
Is it possible to create shortcuts to Javascript?
Thanks in advance.
No.
It would be a enormous (XSS/CSRF) security problem if a URL could be constructed which caused a browser to visit a URL and execute arbitrary JavaScript or follow links.
Consider using a tool like Selenium or PhantomJS instead.
Related
Im new to JS and was wondering if it is possible to write a script which would collect the data of all open tabs and display it.
There is currently no way of controlling the data of browser tabs or other browser tabs with Javascript but there are some other things you can do with tabs like going to the nth tab of a window.open() array.
Check out this StackOverflow answer
I don't think there is a way of accessing data from a tab in a browser because of a sandbox that separates the Javascript running in a thread on the webpage and the user's computer. If you were hoping to use this in a Google Chrome extension, this is possible. It's called chrome.windows.getAll(), you can learn more about it at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/getAll.
I know this is quite broad question but I want to ask about developing a browser extension for Chrome and Firefox, specifically if this is something that can be done without rocket science. The core concept of what I need to do is to have a way to hook into specific button when on a specific page that it will prevent its default behavior first, instead show a Form Modal which loads a URL from third-part (external) site possibly (iframe) or something. Then the Form Modal have this function to validate if reference number or license number is valid before allowing the actual button (in the main page) to be clickable.
The case here is that the web app is already done (a SaaS), and it is almost impossible to extend through API so we will need to hook into it and inject the project the is described above.
This may look like a malicious extension but basically it will be used not for that but for a eCommerce site as third-party integration.
I am trying to build a web page that will contain a list of windows from another Windows application (Trade Ideas). Is it possible for me to use links in this web page to activate the Trade Ideas windows? In other words I would use Javascript to activate the corresponding Trade Ideas window when it's name is chosen from the list.
I was able to come up with a solution to this problem. I created a batch file that uses the nircmd utility. The batch file reads:
nircmd.exe win activate title "windowtitle"
I downloaded and installed a program called:
LocalExplorer
After that, I can use a link in my web page:
Window Name
And it will run the batch file which will activate the window.
Can we embed a website inside a firefox addon. I am currently building an addon with multiple functions and though addon is appropriate for few functions, website is better for rest of the functions.
If I intend to create an addon and also have website embeded inside it for some of the operations, is it possible. How do we do it?
Yes, you can have web-content in a Firefox addon, but be very careful or else the web page (or anything that intercepts the web page) will have access to everything Firefox itself could do!
If you use an XUL iframe (or any iframe element or runnable data inserted from untrusted content in Chrome:// context), please read this article carefully:
https://developer.mozilla.org/en-US/docs/Displaying_web_content_in_an_extension_without_security_issues
I'd advise to use iframes for this one.
Check:
http://www.w3schools.com/tags/tag_iframe.asp
and
http://webdesign.about.com/od/iframes/a/aaiframe.htm
see my addon here: https://addons.mozilla.org/en-US/firefox/addon/xpicompiler/
see about:addons-memory addon here: https://addons.mozilla.org/en-US/firefox/addon/about-addons-memory/
very simple addons, they contain a webpage. and in the manifest file we have set contentaccesible=true
in my addon if you type about:xpiler you get to that pgae
in the other addon if you type in the url bar about:addons-memory you get to his page.
if you need help i can write a demo for you in 10 minutes
I'm working on an add-on where most of the content/user interface is hosted in a tab that I open up with the 'tabs' API. I'd really like my tab not to have a bookmarks or address bar, and to forbid navigation away from the content I have specified there. Is there a way to produce a 'naked' tab without these elements, or to strip them from an existing tab? The tab that hosts the add-ons manager in Firefox itself is a good example of what I'm looking for.
You should look at the addon-page module:
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/addon-page.html
This is a relatively new module, so if you run into issues or have requests for additional functionality the project would appreciate feedback.
Feel free to post to the google group ( https://groups.google.com/forum/#!forum/mozilla-labs-jetpack ) or the #jetpack channel on irc.mozilla.org.