Использование расширения imacros в mozilla firefox

Good reasons to use iMacros

Save time

iMacros helps you perform your web chores quicker. Downloading, data entry and website testing — iMacros can do all that for you!

Save money

Why pay more for less? iMacros is THE low-cost web testing solution and it even outsmarts its US competitors in many features. Some of the competition charges as much as $30,000 and still has fewer capabilities than iMacros!

Flexible

Automate even the most complicated tasks with the Scripting Interface. Connect iMacros to your favorite programming language. Windows Scripting Host and Visual Basic example programs are included.

Be creative

Repetition is unavoidable, but you avoid almost all of it. Let iMacros take over the routine jobs, and save your precious time for the creative part.

Frames

Frame in Object Tree

iMacros handles pages with frames automatically. It inserts FRAME statements that indicate to which frame the following TAG or similar command refers. Please note that TAG will fail if it is not directed to the correct frame.

If the frame has a name, iMacros will use it in the FRAME statement, otherwise its index (the position of the frame in the page’s object tree) is used.

Hint
When recording in the iMacros Browser or Internet Explorer, use Recording Mode = Expert (Complete HTML) to get the frame number as a comment in the recorded macro. Later you can edit your macro and decide which suits better to your needs. Some websites use random names but fixed indexes, in this case, it is better to refer to the frame number instead of the default frame name.

Описание расширения

Итак, iMacros – это дополнение, которое позволяет создать клавиатурные макросы для определенного рутинного действия (или даже группы действий), выполняемых в браузере. Это позволяет несколько автоматизировать работу.

Расширение iMacros обладает предельно простым и понятным меню. Поэтому ни у кого не возникнет проблем с его настройкой. Присутствует даже полноценный русский язык, что можно считать хорошим преимуществом перед конкурентами.

Однако для создания собственного макроса нужна будет некоторая сноровка, так как придется писать скрипт вручную. А для этого нужно знать хотя бы основы кодинга. Без этого создать качественный макрос никак не получится.

Стоит отметить, что iMacros требует очень мало оперативной памяти для своей полноценной работы. А это значит, что его без проблем можно будет использовать на относительно слабых и старых машинах.

Еще одна особенность – наличие уже готовых шаблонов макросов. Разработчики подготовили стандартные паттерны для наиболее используемых действий. Это позволяет настроить основные макросы без особой базы знаний.

Популярность плагина говорит сама за себя. Очевидно, пользователи посчитали, что это расширение является лучшим среди подобных дополнений. Об этом говорит и количество установок в магазине.

VBS (Visual Basic Scripting)

The following examples are based on the Windows Scripting Host (WSH, VBScript) that is part of Windows.

  1. combine-macros.vbs Shows how to create a custom error report log file
  2. connect-to-ie.vbs Remote control Internet Explorer
  3. connect-to-fx.vbs Remote control Mozilla FireFox
  4. connect-to-cr.vbs Remote control Google Chrome
  5. connect-to-iimrunner.vbs Shows how to work with iimRunner.exe
  6. database-2-web.vbs Submit database information to a website. Shows how to query any database.
  7. extract-2-file.vbs Web scrape data into a plain text file.
  8. extract-2-database.vbs Web scrape data into a database.
  9. extract-and-fill.vbs Web scrape data from one website and submit it to a second website.
  10. file-2-web.vbs Submit information from a text file to a website (Method 1)
  11. file-2-web-method2.vbs Submit information from a text file to a website (Method 2)
  12. get-exchange-rate.vbs Extract exchange rate from a website. Runs in tray.
  13. get-response-times.vbs Measure response times and use them in script.
  14. iimRunner_ASP.vbs Connect to iMacros via iimRunner, like when using ASP or ASP.NET
  15. random-numbers.vbs Fill an online form with random numbers.
  16. send-macro-code.vbs Directly send macro code to iMacros instance instead of calling locally stored macros.
  17. self-test.vbs Run all iMacros demo macros and create a test report.
  18. stresstest.vbs Run several iMacros instances in parallel.
  19. Create loops with VBS Tutorial with screenshots
  20. Loop only parts of a macro Tutorial with screenshots

Important: iMacros can be controlled with the same syntax shown here in any Windows programming and scripting language. Please see also the Tutorials page.

How to execute

In order to execute scripts copied from this site or some other source, do the following:

  • open a new file (e.g. in notepad)
  • copy the VBS code to it
  • save it as *.vbs
  • run the script by double-clicking the vbs file)

Variables

Related example macros: Demo-Datasource, Demo-Slideshow

Note: Not all iMacros editions support all variables as described below. Please refer to Features Comparison to see your iMacros edition’s support of variables.

Variables are, as the name suggests, constructs that allow you to dynamically, usually during runtime, hold different values. This is very helpful when you are trying to follow links that contain changing words or when you want to use the same macro for entering different values into a search engine.

The values (content) of all variables in iMacros are accessed by putting two curly brackets around the variable name. The values of !VAR1 is thus accessed by {{!VAR1}}.

Variables can be part of anything inside the macro (except the commands themselves). For example, you can add them as part of the ATTR string in a TAG or EXTRACT command or as part of the URL statement:

URL GOTO=https://www.onlinestore.com/?shoppingcart={{!VAR1}}&item={{!VAR2}}

You can assign almost any value to a variable. However, when assigning a value to a variable with SET certain characters need to be escaped or substituted because they imply a certain behaviour to iMacros. When assigning values to variables all whitespaces in the value part must be substituted by <SP> and all newlines must be substituted by <BR>; double curly brackets must be escaped with #NOVAR# ie. #NOVAR#{{. Note this this only applies inside a macro, e. g with the TAG, SET or ADD commands. If you use the iimSet command of the Scripting Interface, it replaces » » with <SP> and newline with <BR> automatically.

There are two kinds of variables in iMacros:

Built-in variables

These variables are used to define certain properties of the macro’s behavior, for example the macro timeout value:

SET !TIMEOUT_MACRO 300

There is a set of special built-in variables, !VAR1, !VAR2, …, !VAR9, !VAR0, which can be set to anything you like. They are also defined with the SET command

SET !VAR1 hello<SP>world 

Alternatively, you can prompt the user to input a value:

PROMPT "Please enter text" !VAR1

User-defined Variables

These variables are created during runtime («on the fly»). There are 3 different ways of creating variables:

1. You may use the command line switch -var_MYVAR like in

imacros.exe -macro myMacro -var_ITEM 15 

which creates the variable ITEM during replay of the macro myMacro and gives it the value 15.

2. The second options is to use the iimSet function of the Scripting Interface. In a Visual Basic Script example this would look like:

iret = imacros.iimSet("ITEM", "15")

3. Or you may simply use the SET command as in

SET ITEM 15

Note that the user-defined variables should not have a prefixed «!». Only the built-in ones do, like e.g. !LOOP.

Data Extraction and Web Scraping

A key activity in web automation is the extraction of data from websites, also known as web scraping or screen scraping. Whether it is price lists, stock information, financial data or any other type of data, iMacros can extract this data for you and either re-use the data or store it in a file or database.

iMacros can write extracted data to standard text files, including the comma separated value (.csv) format, readable by spreadsheet processing packages. Also, iMacros can make use of the powerful scripting interface to save data directly to databases.

The Extract command

Data extraction is specified by an parameter in the TAG command. This parameter replaces the usual CONTENT parameter. Please see the updated Demo-Extract for some examples of this, including the following:

TAG POS=1 TYPE=SPAN ATTR=CLASS:bdytxt&&TXT:* EXTRACT=HTM

This means that the syntax of the command is now the same as for the TAG command, with the type of extraction specified by the additional EXTRACT parameter.

Bookmarking

You can use iMacros as super-bookmarks: To open the bookmark dialog right-click on the macro that you want to bookmark and select the «local» option. This option adds a link to the macro on your computer to your bookmarks.

(1) Right-click the macro you want to bookmark

(2) Select the Local option for «normal» bookmarks

(3a) A link (reference) to your macro is added to the Firefox bookmark menu. iMacros opens automatically if you select an iMacros super-bookmark.

(3b) You can place your most-used macros on the Bookmarks Toolbar.

If you run a bookmarked macro and the iMacros sidebar is not open, the sidebar will open to run the macro and close again after the macro is complected. If the sidebar was visible before the macro is started, it will remain visible after the macro is completed.

For experts: The bookmarked URL has the format:

imacros://run/?m=my_saved_macro.iim

iMacros intercepts this URL and runs the local macro file instead. If the macro is inside subfolder(s), please use this format (%5C stands for /):

imacros://run/?m=subfolder1%5subfolder2%5Cmy_saved_macro.iim

iMacros Sidebar for IE command line argument -timeout

iMacros Sidebar for Internet Explorer also accepts a timeout command line argument -timeout which tells the sidebar how long to wait for Internet Explorer before giving up and exiting.

Many times when starting the iMacros Sideabr for Internet Explorer, one sees that IE starts and while is loading the homepage, the sidebar issues a popup informing that IE is busy and exits. This occurs even before the sidebar appears. If the network connection is slow, IE homepage is heavy and not cached, the time the sidebar waits for IE to respond (before appearing itself) reaches its timeout and the sidebar exits. In such situations is advisable to increase the iMacros Sidebar timeout.

Notice that it is not necessary (nor accepted) to use this parameter when starting iMacros Sidebar from the scripting interface (with iimOpen) because the sidebar will use the value given in iimOpen’s timeout parameter as the maximum time it waits for Internet Explorer to respond.

Why is this not in iMacros?

Why doesn’t iMacros support flow control operations (if/else, for, while etc.) or many other features from programming languages? First of all, this is NOT a limitation of iMacros, but rather a deliberate and informed design decision. Why? We do not think that our customers should have to attend week-long seminars just to learn yet another proprietary scripting or programming language. Any programming logic can be put into an external script that then calls iMacros using the Scripting Interface.

This way people who already have some programming skills benefit from the fact that they can use a programming language they know and don’t have to learn another one. And those people who do not yet know a programming language can learn any language they prefer and then not only use it with iMacros, but also for any other tasks they might want to program later. I.e. they don’t learn a proprietary programming language which they can only use with iMacros, but one that they can then use anywhere.

It may look as though using an external programming language adds complexity, but creating a new programming language to use with iMacros would add just as much complexity.

So we created the very powerful Scripting Interface that allows you to use iMacros with every Windows Scripting or programming language on the planet. Examples are VBS, VB, VBA, VB.NET, Perl, Java, Foxpro, C, C++, C#, ASP, ASP.NET, PHP and many more. These languages are used by millions of computer users, and are reliable and very well documented. We also added a command line interface for use with batch files and the task scheduler.

Many samples are available here: Sample_Code

Инсталляция дополнения

Здесь все предельно просто. Ведь все дополнения из официального магазина Mozilla устанавливаются всего в пару кликов. Классических инсталляторов здесь нет. Все происходит в автоматическом режиме без участия пользователя. Перед установкой дополнения производится его проверка.

Вот и весь процесс инсталляции. Через несколько секунд после нажатия на ту самую кнопку расширение будет установлено в веб-обозреватель и его иконка появится на панели инструментов. После инсталляции можно переходить к настройкам дополнения. Вот так можно скачать и установить iMacros – расширение для Mozilla Firefox.

Editing Macros

(Related example macro: FillForm)

All recorded macros are stored as a plain text file with the .iim extension in the folder specified by the «Folder Macros» setting on the Path tab of the Options dialog. The default macro folder is located in My Documents under iMacros\Macros.

You can manually edit and tweak the macros using any text editor you like. iMacros comes with a dedicated editor designed especially for macros.

To edit a macro, first select the macro in the macro list and then choose one of the following methods:

  • Click the «Edit» button on the sidebar.
  • Right-click the macro in the list and select «Edit macro».
  • Press the F9 key.

By default, iMacros will use the iMacros Editor, but you can choose another one in the «External editor» setting on the Path tab of the Settings dialog. The editor will open and display the macro — in this example, we chose the FillForm demo macro:

As a simple edit step, let’s change the content of a form text field now. To change the Name below from «Tom Tester» to «Dr. A. Award» locate the TAG command that contains «Tom Tester» and change is as shown below:

Old:

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f1 ATTR=NAME:n1 CONTENT="Tom Tester"   

New:

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f1 ATTR=NAME:n1 CONTENT="Dr. A. Award" 

If the value of the parameter contains spaces, you must either:

  • Enclose the value in double-quotes

After you save the changes to the file, iMacros will immediately apply them during the next replay of the macro.

Reporting

iMacros has several reporting options. You can use the default reports or use the iMacros scripting features to create any kind of report.

1. Global logfile (lists any issues that might have occurred, such as website not available) with date and time.

2. Per macro reports, same as #1, but per macro.

3. with the STOPWATCH command

4. : iMacros can take screenshots during the iMacros run, so you can see what went wrong (e.g. an image missing or formatting issue).

5. Custom reports: You can create any kind of report via the Scripting Interface. This includes writing the test results to a log file (e. g. Combine-Macros.vbs) or of the web browser after an error has occurred. You can also use this interface to connect iMacros directly with any kind of software or program, e. g. test planning software.

Macros

iMacros macros are used to describe the page specific interaction.

  1. Demo-AJAX-Tree Move element of an AJAX tree view by drag & drop. No fixed coordinates required.
  2. Demo-ArchivePage Save the current page with custom file name
  3. Demo-Datasource Enter data from textfile (CSV) into web form
  4. Demo-DirectScreen Automate Java Calculator Applet
  5. Demo-Download Automate file downloads
  6. Demo-Draw Record mouse movements for e.g. java applets
  7. Demo-Extract Extract text, HTML code, links, tables
  8. Demo-ExtractAndFill Extract data and directly fill it into another web site
  9. Demo-ExtractRelative Use relative positioning for more easy extraction
  10. Demo-Extract-Table Extract complete table with one command and save data to text file
  11. Demo-Eval Test for value and time ranges in your macro and anything else that can be done with Javascript
  12. Demo-FillForm Fill forms automating input boxes, drop down selections, checkboxes, radiobuttons, etc.
  13. Demo-FillForm_XPath Use XPath to navigate through elements and attributes in an XML document
  14. Demo-Filter Filter pictures for faster page loading
  15. Demo-Flash Automate flash applets
  16. Demo-Frames Automate sites using HTML frames
  17. Demo-ImageDownload Download picture to local disc, take screenshots
  18. Demo-ImageRecognition Automate e.g. a flash plugin by its graphical elements
  19. Demo-JavascriptDialog Handle pop-up dialogs
  20. Demo-Keyword-Assert Asserts that a specific keyword appears on a web page
  21. Demo-Loop-Csv-2-Web Fill textfile (CSV) data to web form
  22. Demo-OfflineDialogs Automates pop-up dialogs (macro runs on local HTML code)
  23. Demo-OfflineExtract Extract data from web sites (macro runs on local HTML code)
  24. Demo-Print Print websites and PDF documents
  25. Demo-SaveAs Save Website in various formats
  26. Demo-SavePDF Download PDF files
  27. Demo-SaveTargetAs Download and save files using custom paths and file names
  28. Demo-Slideshow Loop through thumbnails
  29. Demo-Stopwatch Measure detailed website response times
  30. Demo-Tabs Make use of tabs
  31. Demo-Tagposition The relevance of the POS value in TAG commands
  32. Demo-TakeScreenshots Take screenshot of full page (not just the part visible in the browser)
  33. Demo-Upload Fill in file upload fields
  34. Demo-WebPageDialog iMacros handles web page dialogs
  35. Demo-Web-Test Use macro for web testing
  36. Parse Twitter Tweets Extract information from tweets

Scripting Chrome and Firefox

Chrome and Firefox can be scripted with the iMacros scripting interface (API) included with some of the iMacros paid editions. The API allows you to control Chrome and Firefox from external scripts and programs (C++, C#, Python, Perl, Javascript, PowerShell, etc…). For details, see the chapter with the iimOpen command.

Notes:

  • In order to control iMacros for Chrome or Firefox via the iMacros scripting interface, you must install .
  • Please also read ScriptingInterface.readme.txt located in %localappdata%\Programs\iMacros after installing File Access!

Using Chrome and Firefox with the iMacros RunAs Agent (iimRunner)

iimRunner only works with a non-default Chrome UserDataDir or Firefox profile. See iMacros for Chrome and iMacros for Firefox for more details.

Where is the iimDisplay message?

iMacros web extensions show iimDisplay messages as a desktop notification pop-up window.

In iMacros for Chrome, if the sidebar is not available (e.g. if you start the browser from scripting interface API or run macros from bookmarks menu) errors and iimDisplay() messages are shown in a desktop notification pop-up window.

Change User Agent

Related example: Set-User-Agent.vbs (VBS script)

Every time you access a web site the browser you use sends a string to the web server containing information about your operating system and the browser you are using. This string might, for example, look like this:

Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Sometimes it is desirable to pretend to be a different user agent because some websites change in behaviour or appearance depending on the user agent. iMacros can simulate all user agent strings with the -useragent command line switch. The command line switch can also be used in iimInit command of the Scripting Interface:

iret = iim1.iimInit ("-useragent ""Nokia6230/2.0+(04.43)""")  

If your user agent contains spaces, please use double quotes («») around it.

In iMacros for Firefox please use the following command inside the macro:

SET !USERAGENT "New User Agent here". 

So with iMacros for Firefox the user agent can be changed during the macro runtime. With Internet Explorer, the user agent is defined when Internet Explorer is started.

Как пользоваться iMacros

Макрос в Мозиле запускается одной кнопкой. Соответствующая иконка появиться в панели быстрого доступа рядом с кнопкой меню настроек.

С левой стороны открывшейся вкладки с макрос-инструментом есть три кнопки основных действия:

Воспроизведение макросов – благодаря этой вкладке можно просматривать свои готовые или скачанные извне макросы.

Запись – создание скриптов для выполнения задач по автоматическому заполнению тех или иных форм.

Manage – управление настройками, помощь в освоение продукта и многое другое.

Примечание: Зайдя во вкладку «Manage», пользователь может нажать на кнопку «Помощь» и подробно изучить все возможности приложения iMacros. Все разделы очень подробно описывают пошаговые манипуляции с полезным приложением. Содержимое вкладки «Помощь» на английском языке. Пользователей, не владеющим в полной степени иностранным языком, не должно смущать это обстоятельство. Так как в браузере Mozilla Firefox можно установить дополнительное расширение-словарь и спокойно переводить все пункты на родной язык. Подробности, как воспользоваться он-лайн словарём в статье «переводчик для Firefox

Firefox iMacros – полноценный инструмент, готовый к незамедлительному использованию сразу после установки. Как и любое другое дополнительное расширение для интернет-обозревателя Мозила данное расширение легко как устанавливать, так и удалять в случаи необходимости.

С точки зрения безопасности и конфиденциальности пользовательской информации приложение iMacros абсолютно надёжно, так как сохраняет скрипты исключительно на персональном компьютере создателя. За благонадёжность других файлов, скачанных из сети интернет, пользователь несёт ответственность самостоятельно. Ведь любой инструмент можно использовать не только в благих целях, но и для наживы или причинения вреда другим.

Надёжный антивирус, бдительность и внимательность никогда и никого не подведут!

iMacros as Bookmarklets

You can rename, edit or delete your iMacros via your browser’s bookmark manager

If you are used to other iMacros versions, you might be surprised that iMacros for Chrome and iMacros for Firefox do not store its macros as text files. The reason for this is that web extensions can not access the file system. Instead we store macros as bookmarklets inside the regular browser bookmarking system.

As the macros are packed as bookmarklets, you can just drag & drop them to your bookmarks folder or bookmarks bar. This means you can take full advantage of Chrome and Firefox syncing to have your macros synced across computers. You can sync your iMacros macros just like normal bookmarks. And with the iMacros secure password encryption that means that you can even store login macros securely in the cloud.

Playing Macros

To play a macro, first select the macro in the macro list and then choose one of the following methods:

  • Click the «Play» button or on the sidebar.
  • Simply double-click the macro in the list.
  • Press the F5 key.

During playback, a blue frame shows you which parts of the web page are being manipulated. To play a recorded sequence multiple times, fill in the maximum number of times to repeat the macro and press the «Play» button.

Controlling playback speed

There are two different options that affect the speed at which macros are replayed. These can be set in iMacros Settings as well as within the macro with the !PLAYBACKDELAY variable.

The delay can be set to any value in seconds, but in the settings window, the maximum is 2s. Clicking on the labels fast, slow and fast is a quick way to set the value to their fixed delays:

  • FAST: the macro is replayed at maximum speed = no delay
  • MEDIUM: iMacros waits for 1 second between each command
  • SLOW: iMacros waits for 2 seconds between each command

The second option is to add timing information during recording (DirectScreen only). If the «Add timing information» checkbox is checked in the Recording Options window, then WAIT statements are automatically included in the macro. Thus, during a replay these WAIT statements slow down the macro playback.

Of course, you can also always manually add WAIT statements to your macro to further control the speed.

Errors during replay

We work hard to make iMacros as «intelligent» as possible, but it still is not as smart as you. If an error occurs during replay it is mostly due to a «tricky» web page in which one of the automatic suggestions of the iMacros Recorder failed. In almost all cases re-recording the macro with different settings or manually editing the macro solves the problem. For recording tips please see the section and for information on how to edit your macro go to the section.

Related forum posts:

See also:

Error Handling

Tip: If you want to prevent the blue frame from being drawn around tagged elements during playback, add the following statement to your macro:

SET !MARKOBJECT NO

Scripting Chrome

Google Chrome, the complete browser, can be scripted with the iMacros scripting interface (API) included with some of the iMacros paid editions. The API allows you to control Chrome from external scripts and programs (C++, C#, Python, Perl, Javascript, PowerShell, etc…). For details, see the chapter with the iimOpen command.

Note: In order to control iMacros for Chrome via the iMacros scripting interface, you must install .

Using Chrome with the iMacros RunAs Agent (iimRunner)

  1. iimRunner only works with a non-default Chrome UserDataDir (aka profile)
  2. Make sure the iMacros add-on is installed in the new user profile.
  3. In order to launch Chrome with a different user profile via the iMacros scripting interface (e.g. iimOpen(«-cr -crUserDataDir C:\MyProfile»)) or with iimRunner (e.g. iimOpen(«-cr -runner -crUserDataDir C:\MyProfile»)), you need to allow access to file URLs as described .

Стандартный функционал iMacros vs Javascript:

У iMacros не такой уж и большой набор свойств, методов, но среди них есть критически важные для создания ботов любой сложности. В Javascript функционал огромен, к тому же мы будем использовать не самую старую версию Firefox, а значит сможем порадоваться всяким новым и полезным фичам из HTML5 и ECMASCRIPT 6. Хочу пройтись немного по основным возможностям iMacros.

Что же нам использовать, а от чего лучше воздержаться?

iMacros : JS:

Эту команду iMacros мы будем использовать, поскольку она синхронная, то есть код, написанный после нее, исполнится только тогда, когда страница загрузится или истечет таймаут, который кстати можно добавлять самому, например вот так  

Переменные

iMacros : JS:

Такое задание переменных — это абсолютно бесполезный кусок говна, во-первых мы ограничены в их количестве и в их именовании(VAR0 — VAR9)

Но, самое важное, с переменными из JS мы можем делать что угодно, для них доступно куча методов и возможностей, мы их можем обрабатывать, используя всю мощь JS. Поиск текста, цифр, преобразования в объекты, массивы, использование регулярных выражений для поиска и замены, калькуляция и много всего другого

Единственный момент, когда мы используем iMacros-переменную — это выдирание данных через iimGetExtract().

Сохранение\чтение данных в CSV

iMacros :  

Не стал перечислять все команды из этой серии. Но, все что связано с чтением\сохранением в CSV, а также реализация циклов — это слишком отвратительно, чтобы использовать. Когда только начинал изучать, я как-то раз делал сохранение и чтение списка страниц в csv стандартными средствами.  Когда в списке стало больше сотни страниц, перебор всего файла  в поисках нужной строки занимал несколько секунд, потом я все переделал на JS + JSON в качестве формата хранения и теперь все операции происходят мгновенно. Для операций с данными без вариантов мы будем юзать JS.

Извлечение данных из HTML-тэгов

iMacros :  JS: window.document.querySelector(‘.submeta’).textContent; //Тут вариантов много как искать селектор

Мы будем использовать TAG для кликов по кнопкам, ссылкам и т.д. А также будем иногда использовать EXTRACT — он жизненно необходим, когда нужно выдрать картинку или какие-то данные из iframe — в этих случаях одним JS мы не обойдемся.

Сохранение скриншота любого элемента на странице

iMacros :

Это одна из важнейших стандартных возможностей — сохранение любого элемента страницы, даже не обязательно картинки,  в файл. На JS подобная задача заставила бы попотеть как следует и не факт, что полностью все получилось бы.

Преобразование текстовой строки в исполняемый код EVAL()

iMacros : JS: 

EVAL из iMacros нам ни к чему. В JS есть свой eval(), и мы его будем использовать для некоторых редких ситуаций, где по-другому никак. Например при подгрузке стороннего макроса через Ajax и его выполнение.

Задержка на определенное время

iMacros : JS: 

В iMacros эта функция синхронная и значит код, написанный после нее, исполнится только через указанное количество секунд, это очень удобно, поэтому мы ее будем использовать.

Работа с фреймами

iMacros : 

Это одна из важнейших стандартных возможностей. Если не использовать iMacros — при помощи JS мы не сможем бессовестно ковыряться в чужих ифреймах и вытаскивать да и вставлять любое содержимое.  Однозначное да!

Переключение и закрытие табов

iMacros :

При помощи JS мы просто не можем переключаться между табами, никак. Несмотря на то, что работает функция специфически, о чем я позже расскажу, однозначно мастхэв. 

Я привел тут не весь список команд, а затронул только самое основное и самое важное. Большую часть работы можно делать на Javascript и использовать iMacros только там, где по-другому никак

В следующих уроках по iMacros будет рассмотрено больше команд.

Downloading Files

If you have iMacro File Access installed you can use the ONDOWNLOAD command to automate the download of files in Firefox. If the File Access is not installed, the ONDOWNLOAD parameters are ignored but the file is downloaded with its default file name, to Firefox default downloads folder. However, by default, Firefox will prompt you to choose between saving or opening a file upon download. iMacros cannot handle this prompt and will only be able to download the file if Firefox default action for this file type is Save File.

If the file type you are downloading is not listed under Content Type, you will have to edit Firefox handlers.js file manually. In the example below we included .exe and .msi in handlers.json, using «action»:0 for save.

{
   "defaultHandlersVersion": {
       "en-GB": 4
   },
   "mimeTypes": {
       "application/pdf": {
           "action": 3,
           "extensions": 
       },
       "application/x-7z-compressed": {
           "action": 0,
           "extensions": 
       },
       "application/x-msi": {
           "action": 0,
           "extensions": 
       },
       "application/x-executable": {
           "action": 0,
           "extensions": 
       }
   },
   "schemes":{...
   }
}

To locate the handlers.json file, type in Firefox navigation bar «about:support» and under General Information/Profile Folder you can click on the button Open Folder.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector