It is actually adware. It is not difficult to get rid of those adwares. What you need to do is cleaning up all browser extensions in Browser.
1. Locate the add-on or extension that is relevant to the adware. To do this, please follow the following depending on affected browser.
Safari – Choose Preferences from the Safari menu, then click the Extensions icon. This will open a window showing all installed extensions.
Chrome – Select Preferences from the Chrome menu, and then click the Extensions link found on the left pane.
Firefox – Choose Add-ons from the Tools menu. Look at both the Extensions and Plugins lists when it opens a new window.
2. click on Remove or Uninstall, to get rid of all of them.
3. Close the browser and proceed to the next steps.
And there is another easy way. You can download the antivirus app in Mac App Store - Dr. Safety. Cleaning up adwares is free in Dr. Safety.