amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

A4A: Remove parseUrl usage

Open jridgewell opened this issue 8 years ago • 2 comments

Hi @ampproject/a4a

I'm moving URL parsing from an import into a AMP Doc service. Your usage in https://github.com/ampproject/amphtml/blob/a07137e6bbe3de880b4e5026a24d29d214e32300/ads/google/a4a/utils.js#L355-L383 will break.

I honestly have no idea what that function is trying to do, so I don't know how to refactor it for you. But, you can use Services.viewerForDoc(nodeOrDoc) to grab the new URL service if you want to keep everything the same.

jridgewell avatar May 16 '18 22:05 jridgewell

Part of https://github.com/ampproject/amphtml/issues/14753.

jridgewell avatar May 16 '18 22:05 jridgewell

Its attempting to string the protocol off of urls as we're only interested in sending the hostname. I can change to use regexp.

keithwrightbos avatar May 24 '18 19:05 keithwrightbos