my application doesnt run on IE browser, i have abp-zero-template 6.5.0 and angular vesrion 7.1.0 - cross-browser

i am running the application on IE 11 , but my application giving syntax erros in console. in scripts.js and vendor.js
Error :

Please check the polyfills file, whether you have uncommented the related import for IE browser.
The polyfills file content like this:
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
/**
* If the application will be indexed by Google Search, the following is required.
* Googlebot uses a renderer based on Chrome 41.
* https://developers.google.com/search/docs/guides/rendering
**/
//import 'core-js/es6/array';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/** IE10 and IE11 requires the following for the Reflect API. */
//import 'core-js/es6/reflect';
/**
* Web Animations `#angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
**/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
From the screenshot, it seems that you are using Arrow function expression, as we all known, the arrow function expression not support IE browser. Please try to use the Babel translate it to ES5.
Besides, you could also try to install the babel bolyfill in your angular application.

Related

Importing Font Awesome icons that have a dash ("-") in their name

I am using React.js to make a portfolio website. I decided to go with Font Awesome icons since I love the look of them. However when I go to import any icon that has that dash in the name, I can't figure out how to import it. Here's my code so far (for importing):
import "font-awesome/css/font-awesome.min.css";
import { FontAwesomeIcon } from "#fortawesome/react-fontawesome";
// All these are single name icons
import {faPython} from "#fortawesome/free-brands-svg-icons/faPython";
import {faJs} from "#fortawesome/free-brands-svg-icons/faJs";
import {faReact} from "#fortawesome/free-brands-svg-icons/faReact";
import {faCuttlefish} from "#fortawesome/free-brands-svg-icons/faCuttlefish";
// This one is named "rectangle-code"
import {faRectangleCode} from "#fortawesome/free-solid-svg-icons/faRectangleCode";
I get this error:
I can't import it using dashes in the name, so how do I import this icon without any errors?
EDIT: Click here to view the icon on Font Awesome's website
Here's the problem!
You're attempting to use a pro icon - it doesn't exist in the free icon packs.
(Edit: for future reference, a good way to debug import problems like this is to cd inside the #fortawesome directory in your terminal, and then use something like https://github.com/junegunn/fzf to look for the file you're looking for. That's what I did before realizing the icon doesn't exist in the free version.)

Cannot click button using Selenium - Python

I am having issues clicking a button with Selenium. I have never worked with Selenium before, so I have tried searching the web for a solution but have had no luck. I tried some other things such as WebDriverWait but nothing has worked.
# My Code
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
PATH = "F:\SeleniumProjects\chromedriver.exe"
options = webdriver.ChromeOptions()
options.add_argument("start-maximized");
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(options=options, executable_path=PATH)
driver.get("https://www.discord.com")
time.sleep(3)
buddy = driver.find_element_by_xpath("/html/body/div/div/div/div[1]/div[1]/header[1]/nav/div/a")
ActionChains(driver).move_to_element(buddy).click().perform()
This exception is confusing me because I know I can interact with it but I am unsure why it says it isn't. I am sure there is some simple fix but I am stumped.
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable: https://discord.com/login has no size and location
(Session info: chrome=90.0.4430.93)
Here is the button I am trying to press
<a class="button-195cDm buttonWhite-18r1SC buttonSmall-2bnF7I gtm-click-class-login-button button-1x6X9g mobileAppButton-2dMGaq" href="//discord.com/login">Login</a>
Wrap a wait around it and the following should work:
buddy = WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.XPATH, "//div[#class='appButton-2wSXh-']//a[contains(text(),'Login')]")))
buddy.click()
There are 2 elements of this on the page:
//a[contains(text(),'Login')]
That is why we need to go up one more level to the div element in the XPath
Import the following at the top of your script if they aren't there already:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
The ActionChains is not needed, that is generally used for dropdown menus, things like that. Also your XPath was the full path in the HTML, that is generally not advisable and can be brittle.

Polymer - How to slowly migrate from HTML imports to ES6 modules?

As said in the Polymer-Summit 2017, web-components, in Polymer 3.0, won't be imported using HTML-imports but ES6-modules.
So I am looking for a way to change all my HTML-imports one by one into ES6-module's import without making unstable code.
For exemple:
Here's a little simple project.
Their are 3 files:
|-index.html
|-custom-element.html
|-MyModule.html
The index.html imports the custom-elementcomponent and instantiate one in the DOM.
The custom-element.html imports MyModule.html, and use its function square(number).
All imports are made using HTML-imports.
I am trying to figure out how to make just MyModule an ES6-module and then import it in the custom-element.html file without breaking the app.
Change the script tag's type into <script type="module">.
Import the ES6 module from inside the script module.
Here's the plunker with the full solution.

Using SebM google maps module in child component shows blank map

EDIT: I found the problem. I was using ng2-boostrap tabset module,
when adding the maps inside this view, the map does not render. I
haven't been able to fix the problem though.
I'm working on an angular 2 application, where i need to import google maps module into a sub module. My question is - how might i do that correctly? is this even possible as it is.
What i've tried:
I have added the import { AgmCoreModule } from 'angular2-google-maps/core'; and AgmCoreModule.forRoot({ apiKey: 'xxx', libraries: ['places'] }) where xxx is my apiKey downloaded from google api site. If i run this code in a newly angular-cli created app - loading the module into app.module, everything works fine. Selector code looks:
<sebm-google-map [latitude]="lat" [longitude]="lng">
<sebm-google-map-marker [latitude]="latitude" [longitude]="longitude">
</sebm-google-map-marker>
</sebm-google-map>
However, i want to use it in a module called MapModule and import that module into my app.module, so i import the AgmCoreModule into the MapModule, without forRoot(), and the selector is recognized in the html and the map is loaded but the map shows an empty view - i.e. there is a map with google logo and stuff, but no content - no error messages. I use the exact same code as my test example.
I also tried adding the AgmCoreModule with the forRoot({apiKey: 'xxx'}) with the same result. I removed the import from the App.module and only imported into the MapModule with the same result.
Am i missing something here? i can provide more code if needed, but i think my problem lies with the lack of knowledge in imports.
Kind regards Chris
Did you tried putting this code in your component that is responsible for viewing the map?
import {MapsAPILoader, SebmGoogleMap} from 'angular2-google-maps/core';
#ViewChild(SebmGoogleMap) map: SebmGoogleMap;
this.map.triggerResize();
if the map is not rendered in initial view, eg. inside an *ngif block then issues arise. When you inspect the elements in the tabs do you see map code or you see map code only when the map tab is activated?
Normally when there are no errors, a triggerResize() will fix your issue.

how to just get the HTML output structure of a site

I guess it shows my kookiness here but how do I just get the HTML presentation of a website? for ex., I am trying to retrieve from a Wix site the HTML structure (what is actually being viewed by a user on the screen) but instead I am getting lots of scripts that exist on the site. I am doing a small code test for scraping. Much appreciated.
Alright,here we go. Sorry for the delay.
I used selenium to load the page, that way I could make sure to capture all the markup even if it's loaded by ajax. Make sure to grab the standalone library, that threw me for a loop.
Once the html is retrieved I pass it to jsoup which I use to iterate through the document and remove all the text.
Here's the example code:
// selenium to grab the html
// i chose to use this to get anything that may be loaded by ajax
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
// jsoup for parsing the html
import org.jsoup.Jsoup;
import org.jsoup.parser.Parser;
import org.jsoup.helper.Validate;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.TextNode;
import org.jsoup.select.Elements;
import java.io.IOException;
public class Example {
public static void main(String[] args) {
// Create a new instance of the html unit driver
// Notice that the remainder of the code relies on the interface,
// not the implementation.
WebDriver driver = new FirefoxDriver();
// And now use this to visit stackoverflow
driver.get("http://stackoverflow.com/");
// Get the page source
String html = driver.getPageSource();
Document doc = Jsoup.parse(html, "", Parser.xmlParser());
for (Element el : doc.select("*")){
if (!el.ownText().isEmpty()){
for (TextNode node : el.textNodes())
node.remove();
}
}
System.out.println(doc);
driver.quit();
}
}
Not sure if you wanted to get rid of the attribute tags as well, currently they are left. However, it's easy enough to modify the code so that some or all of the attribute tags are removed too.
If you just require the content from the page, you can just use ?_escaped_fragment_ on every url to get the static content.
_escaped_fragment_ is an standard approach used for Ajax crawling for crawling the pages which are dynamic in nature or are generated / rendered at client side.
Wix based websites support _escaped_fragment.